tianxincode 1.0.47 → 1.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +200 -200
- package/dist/cli/commands.js +18 -18
- package/dist/core/ai/agents/caller/prompts/role.txt +50 -50
- package/dist/core/ai/agents/chat/chat.agent.js +30 -30
- package/dist/core/ai/agents/chat/prompts/role.txt +30 -30
- package/dist/core/ai/agents/code/code.agent.js +6 -6
- package/dist/core/ai/agents/code/prompts/role.txt +50 -50
- package/dist/core/ai/agents/common/prompt/role.txt +51 -51
- package/dist/core/ai/agents/common/prompts.js +26 -26
- package/dist/core/ai/agents/design/design.agent.js +6 -6
- package/dist/core/ai/agents/design/prompts/role.txt +36 -36
- package/dist/core/ai/agents/dream/prompts/init.txt +20 -20
- package/dist/core/ai/agents/mem/mem.agent.js +5 -5
- package/dist/core/ai/agents/mem/prompts/role.txt +35 -35
- package/dist/core/ai/agents/skill/prompts/role.txt +61 -61
- package/dist/core/ai/agents/skill/skill.agent.js +26 -26
- package/dist/core/ai/agents/summarizer/prompts/role.txt +30 -30
- package/dist/core/ai/agents/task/prompts/role.txt +50 -50
- package/dist/core/ai/agents/task/task.agent.js +30 -30
- package/dist/core/ai/provider/deepseek.provider.js +1 -1
- package/dist/core/ai/provider/deepseek.provider.js.map +1 -1
- package/dist/core/ai/provider/openai.provider.js +1 -1
- package/dist/core/ai/provider/openai.provider.js.map +1 -1
- package/dist/core/db/db.service.d.ts.map +1 -1
- package/dist/core/db/db.service.js +3 -1
- package/dist/core/db/db.service.js.map +1 -1
- package/dist/core/db/init_sql/ai_log.init.js +15 -15
- package/dist/core/db/init_sql/code_snippet.init.js +11 -11
- package/dist/core/db/init_sql/config.init.js +15 -15
- package/dist/core/db/init_sql/custom_action.init.js +10 -10
- package/dist/core/db/init_sql/dingding.init.js +9 -9
- package/dist/core/db/init_sql/email.init.js +14 -14
- package/dist/core/db/init_sql/lsp.init.js +8 -8
- package/dist/core/db/init_sql/message_file.init.js +11 -11
- package/dist/core/db/init_sql/project.init.js +20 -20
- package/dist/core/db/init_sql/provider.init.js +35 -35
- package/dist/core/db/init_sql/scheduler.init.js +32 -32
- package/dist/core/db/init_sql/session.init.js +23 -23
- package/dist/core/db/init_sql/spec.init.js +15 -15
- package/dist/core/db/init_sql/waf_gateway.init.js +9 -9
- package/dist/core/db/init_sql/zihao.init.js +11 -11
- package/dist/core/lsp/sql.js +11 -11
- package/dist/core/tools/provider/bash.txt +47 -47
- package/dist/core/tools/provider/code_search.txt +20 -20
- package/dist/core/tools/provider/edit_file.txt +13 -13
- package/dist/core/tools/provider/glob.txt +12 -12
- package/dist/core/tools/provider/grep.txt +14 -14
- package/dist/core/tools/provider/lsp.txt +19 -19
- package/dist/core/tools/provider/memory.txt +21 -21
- package/dist/core/tools/provider/read_file.txt +17 -17
- package/dist/core/tools/provider/todo_read.txt +16 -16
- package/dist/core/tools/provider/todo_write.txt +48 -48
- package/dist/core/tools/provider/web_fetch.txt +17 -17
- package/dist/core/tools/provider/web_search.txt +18 -18
- package/dist/core/tools/provider/write_file.txt +11 -11
- package/dist/gateway/api/skill/detail_skill.d.ts.map +1 -1
- package/dist/gateway/api/skill/detail_skill.js +7 -5
- package/dist/gateway/api/skill/detail_skill.js.map +1 -1
- package/dist/gateway/cli/commands.js +18 -18
- package/dist/modules/ai/agents/chat/prompts/role.txt +30 -30
- package/dist/modules/ai/agents/code/prompts/role.txt +50 -50
- package/dist/modules/ai/agents/mem/prompts/role.txt +35 -35
- package/dist/modules/ai/agents/skill/prompts/role.txt +61 -61
- package/dist/modules/ai/agents/task/prompts/role.txt +50 -50
- package/dist/modules/ai/ai-log.service.js +10 -10
- package/dist/modules/ai/provider/openai/prompt/role.txt +51 -51
- package/dist/modules/ai/summarizer/summarizer.prompts.js +30 -30
- package/dist/modules/config/config.service.js +5 -5
- package/dist/modules/db/db.service.js +252 -252
- package/dist/modules/email/email.config.repository.js +1 -1
- package/dist/modules/repositories/project.repository.d.ts +28 -0
- package/dist/modules/repositories/project.repository.d.ts.map +1 -0
- package/dist/modules/repositories/project.repository.js +47 -0
- package/dist/modules/repositories/project.repository.js.map +1 -0
- package/dist/modules/scheduler/task-log.service.js +1 -1
- package/dist/modules/services/project/project.service.d.ts +14 -0
- package/dist/modules/services/project/project.service.d.ts.map +1 -0
- package/dist/modules/services/project/project.service.js +47 -0
- package/dist/modules/services/project/project.service.js.map +1 -0
- package/dist/modules/skill/skill.txt +36 -36
- package/dist/modules/spec/spec.injector.js +24 -24
- package/dist/modules/tools/provider/bash.txt +47 -47
- package/dist/modules/tools/provider/code_search.txt +20 -20
- package/dist/modules/tools/provider/edit_file.txt +13 -13
- package/dist/modules/tools/provider/glob.txt +12 -12
- package/dist/modules/tools/provider/grep.txt +14 -14
- package/dist/modules/tools/provider/lsp.txt +19 -19
- package/dist/modules/tools/provider/memory.txt +21 -21
- package/dist/modules/tools/provider/read_file.txt +17 -17
- package/dist/modules/tools/provider/todo_read.txt +16 -16
- package/dist/modules/tools/provider/todo_write.txt +48 -48
- package/dist/modules/tools/provider/web_fetch.txt +17 -17
- package/dist/modules/tools/provider/web_search.txt +18 -18
- package/dist/modules/tools/provider/write_file.txt +11 -11
- package/dist/modules/waf-gateway/waf-gateway.module.js +8 -8
- package/dist/modules/waf-gateway/waf-gateway.service.js +12 -12
- package/dist/repositories/project.repository.d.ts +28 -0
- package/dist/repositories/project.repository.d.ts.map +1 -0
- package/dist/repositories/project.repository.js +47 -0
- package/dist/repositories/project.repository.js.map +1 -0
- package/dist/repository/ai_log.repository.js +1 -1
- package/dist/repository/config.repository.js +5 -5
- package/dist/repository/email.repository.js +1 -1
- package/dist/repository/memory.repository.js +1 -1
- package/dist/repository/project.repository.js +3 -3
- package/dist/repository/scheduler.repository.js +2 -2
- package/dist/repository/session.repository.js +1 -1
- package/dist/repository/zihao-config.repository.js +1 -1
- package/dist/services/skill/skill.tool.d.ts.map +1 -1
- package/dist/services/skill/skill.tool.js +6 -1
- package/dist/services/skill/skill.tool.js.map +1 -1
- package/dist/services/skill/skill.txt +36 -36
- package/package.json +76 -76
- package/scripts/copy-txt.js +31 -31
- package/scripts/ink-scroll-demo.tsx +147 -147
- package/tsconfig.test.json +9 -9
- package/web/dist/assets/{ConfirmDialog-B2bVsPFI.js → ConfirmDialog-B03GcCHQ.js} +1 -1
- package/web/dist/assets/PcLayout-CYW3zqcs.css +1 -0
- package/web/dist/assets/{PcLayout-DeXNBHu2.js → PcLayout-ZTdJNg7G.js} +1 -1
- package/web/dist/assets/{aiLogsView-JvjhLmyo.js → aiLogsView-Bt8Xg1Qx.js} +1 -1
- package/web/dist/assets/{cssMode-sYHhwUZh.js → cssMode-CBb6D87U.js} +1 -1
- package/web/dist/assets/{customActionsView-Cvmzxvl4.js → customActionsView-DdjnHzwm.js} +1 -1
- package/web/dist/assets/deployView-CD7ji9IS.css +1 -0
- package/web/dist/assets/{deployView-CjV4ySrf.js → deployView-Cj51_Job.js} +1 -1
- package/web/dist/assets/designView-C3pSX4nP.css +1 -0
- package/web/dist/assets/designView-RT8tKEN9.js +18 -0
- package/web/dist/assets/devWorkflowView-BTozmaiN.js +36 -0
- package/web/dist/assets/devWorkflowView-DYhIfbCB.css +1 -0
- package/web/dist/assets/devWorkflowViewApp-CErbhC2s.css +1 -0
- package/web/dist/assets/{devWorkflowViewApp-DPlFgiS_.js → devWorkflowViewApp-DLslXEq9.js} +3 -3
- package/web/dist/assets/{fileZihao-DvZmuTYu.js → fileZihao-CtZ4bUIH.js} +1 -1
- package/web/dist/assets/{freemarker2-DTyAQBBj.js → freemarker2-CX3jc3l2.js} +1 -1
- package/web/dist/assets/gitChanges-D6QxPcii.css +1 -0
- package/web/dist/assets/{gitChanges-Cpf4HHoF.js → gitChanges-DFRvzL5I.js} +1 -1
- package/web/dist/assets/gitChangesApp-Bjn-MCmr.css +1 -0
- package/web/dist/assets/{gitChangesApp-BOURDd_l.js → gitChangesApp-ZI7-V8oB.js} +2 -2
- package/web/dist/assets/{handlebars-DiWIXxOG.js → handlebars-CTaQD6FN.js} +1 -1
- package/web/dist/assets/{html-BCQWkFzH.js → html-BruJsfYv.js} +1 -1
- package/web/dist/assets/{htmlMode-BbMA34cR.js → htmlMode-wewroXLr.js} +1 -1
- package/web/dist/assets/{index-C_tz4Wda.css → index-C0xmVTIn.css} +1 -1
- package/web/dist/assets/{index-C7axH05o.js → index-Cn73hS12.js} +9 -9
- package/web/dist/assets/{javascript-By4MYHaO.js → javascript-B4ku8P1-.js} +1 -1
- package/web/dist/assets/{jsonMode-5JIz7tDN.js → jsonMode-BIvVuBMG.js} +1 -1
- package/web/dist/assets/{liquid-BQBVii4f.js → liquid-Bo3G0Ep7.js} +1 -1
- package/web/dist/assets/{mdx-Cwk7nqzM.js → mdx-Duv0ylZz.js} +1 -1
- package/web/dist/assets/{mediaChat-DivTDoIv.js → mediaChat-RT7iqqYb.js} +1 -1
- package/web/dist/assets/{python-L_kGfe1T.js → python-CEhCctGm.js} +1 -1
- package/web/dist/assets/{razor-XGuHliMI.js → razor-DPK8nTD7.js} +1 -1
- package/web/dist/assets/{taskView-BcJ3LAxp.js → taskView-sOyebRqn.js} +1 -1
- package/web/dist/assets/{terminalView-q-UKzK0M.js → terminalView-GTYtDlus.js} +2 -2
- package/web/dist/assets/{terminalView-CQVYh6D3.css → terminalView-eZ0agsPP.css} +1 -1
- package/web/dist/assets/{tsMode-SuiD3mJa.js → tsMode-BZvUU1nf.js} +1 -1
- package/web/dist/assets/{typescript-DJcyqRjT.js → typescript-CmEn-k1B.js} +1 -1
- package/web/dist/assets/{wikiView-ygHSGyPp.css → wikiView-C-oqMnJM.css} +1 -1
- package/web/dist/assets/{wikiView-B3GIPUlD.js → wikiView-CRjg-cZ8.js} +1 -1
- package/web/dist/assets/{xml-DQgCzk55.js → xml-bjvdKeyy.js} +1 -1
- package/web/dist/assets/{yaml-DBdEYBPA.js → yaml-N5RXWxJk.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/package.json +28 -28
- package/dist/modules/ai/react/index.d.ts +0 -5
- package/dist/modules/ai/react/index.d.ts.map +0 -1
- package/dist/modules/ai/react/index.js +0 -4
- package/dist/modules/ai/react/index.js.map +0 -1
- package/dist/modules/ai/react/prompt/role.txt +0 -51
- package/dist/modules/ai/react/provider.parser.d.ts +0 -20
- package/dist/modules/ai/react/provider.parser.d.ts.map +0 -1
- package/dist/modules/ai/react/provider.parser.js +0 -88
- package/dist/modules/ai/react/provider.parser.js.map +0 -1
- package/dist/modules/ai/react/react.parser.d.ts +0 -80
- package/dist/modules/ai/react/react.parser.d.ts.map +0 -1
- package/dist/modules/ai/react/react.parser.js +0 -365
- package/dist/modules/ai/react/react.parser.js.map +0 -1
- package/dist/modules/ai/react/react.prompts.d.ts +0 -26
- package/dist/modules/ai/react/react.prompts.d.ts.map +0 -1
- package/dist/modules/ai/react/react.prompts.js +0 -170
- package/dist/modules/ai/react/react.prompts.js.map +0 -1
- package/dist/modules/ai/react/react.types.d.ts +0 -50
- package/dist/modules/ai/react/react.types.d.ts.map +0 -1
- package/dist/modules/ai/react/react.types.js +0 -2
- package/dist/modules/ai/react/react.types.js.map +0 -1
- package/dist/modules/ai/react/react.validator.d.ts +0 -14
- package/dist/modules/ai/react/react.validator.d.ts.map +0 -1
- package/dist/modules/ai/react/react.validator.js +0 -53
- package/dist/modules/ai/react/react.validator.js.map +0 -1
- package/dist/modules/ai/react.agent.d.ts +0 -82
- package/dist/modules/ai/react.agent.d.ts.map +0 -1
- package/dist/modules/ai/react.agent.js +0 -220
- package/dist/modules/ai/react.agent.js.map +0 -1
- package/dist/modules/skill/skill.service.d.ts +0 -72
- package/dist/modules/skill/skill.service.d.ts.map +0 -1
- package/dist/modules/skill/skill.service.js +0 -283
- package/dist/modules/skill/skill.service.js.map +0 -1
- package/dist/modules/tools/builtin/bash.d.ts +0 -3
- package/dist/modules/tools/builtin/bash.d.ts.map +0 -1
- package/dist/modules/tools/builtin/bash.js +0 -126
- package/dist/modules/tools/builtin/bash.js.map +0 -1
- package/dist/modules/tools/builtin/bash.tool.d.ts +0 -6
- package/dist/modules/tools/builtin/bash.tool.d.ts.map +0 -1
- package/dist/modules/tools/builtin/bash.tool.js +0 -52
- package/dist/modules/tools/builtin/bash.tool.js.map +0 -1
- package/dist/modules/tools/builtin/bash.txt +0 -69
- package/dist/modules/tools/builtin/code_search.d.ts +0 -3
- package/dist/modules/tools/builtin/code_search.d.ts.map +0 -1
- package/dist/modules/tools/builtin/code_search.js +0 -86
- package/dist/modules/tools/builtin/code_search.js.map +0 -1
- package/dist/modules/tools/builtin/code_search.txt +0 -41
- package/dist/modules/tools/builtin/edit-file.tool.d.ts +0 -6
- package/dist/modules/tools/builtin/edit-file.tool.d.ts.map +0 -1
- package/dist/modules/tools/builtin/edit-file.tool.js +0 -58
- package/dist/modules/tools/builtin/edit-file.tool.js.map +0 -1
- package/dist/modules/tools/builtin/edit_file.d.ts +0 -3
- package/dist/modules/tools/builtin/edit_file.d.ts.map +0 -1
- package/dist/modules/tools/builtin/edit_file.js +0 -105
- package/dist/modules/tools/builtin/edit_file.js.map +0 -1
- package/dist/modules/tools/builtin/edit_file.txt +0 -61
- package/dist/modules/tools/builtin/glob.d.ts +0 -3
- package/dist/modules/tools/builtin/glob.d.ts.map +0 -1
- package/dist/modules/tools/builtin/glob.js +0 -85
- package/dist/modules/tools/builtin/glob.js.map +0 -1
- package/dist/modules/tools/builtin/glob.tool.d.ts +0 -6
- package/dist/modules/tools/builtin/glob.tool.d.ts.map +0 -1
- package/dist/modules/tools/builtin/glob.tool.js +0 -81
- package/dist/modules/tools/builtin/glob.tool.js.map +0 -1
- package/dist/modules/tools/builtin/glob.txt +0 -33
- package/dist/modules/tools/builtin/grep.d.ts +0 -3
- package/dist/modules/tools/builtin/grep.d.ts.map +0 -1
- package/dist/modules/tools/builtin/grep.js +0 -94
- package/dist/modules/tools/builtin/grep.js.map +0 -1
- package/dist/modules/tools/builtin/grep.tool.d.ts +0 -6
- package/dist/modules/tools/builtin/grep.tool.d.ts.map +0 -1
- package/dist/modules/tools/builtin/grep.tool.js +0 -96
- package/dist/modules/tools/builtin/grep.tool.js.map +0 -1
- package/dist/modules/tools/builtin/grep.txt +0 -37
- package/dist/modules/tools/builtin/index.d.ts +0 -8
- package/dist/modules/tools/builtin/index.d.ts.map +0 -1
- package/dist/modules/tools/builtin/index.js +0 -80
- package/dist/modules/tools/builtin/index.js.map +0 -1
- package/dist/modules/tools/builtin/lsp.d.ts +0 -7
- package/dist/modules/tools/builtin/lsp.d.ts.map +0 -1
- package/dist/modules/tools/builtin/lsp.js +0 -126
- package/dist/modules/tools/builtin/lsp.js.map +0 -1
- package/dist/modules/tools/builtin/lsp.txt +0 -45
- package/dist/modules/tools/builtin/memory.d.ts +0 -3
- package/dist/modules/tools/builtin/memory.d.ts.map +0 -1
- package/dist/modules/tools/builtin/memory.js +0 -77
- package/dist/modules/tools/builtin/memory.js.map +0 -1
- package/dist/modules/tools/builtin/memory.txt +0 -58
- package/dist/modules/tools/builtin/read-file.tool.d.ts +0 -6
- package/dist/modules/tools/builtin/read-file.tool.d.ts.map +0 -1
- package/dist/modules/tools/builtin/read-file.tool.js +0 -46
- package/dist/modules/tools/builtin/read-file.tool.js.map +0 -1
- package/dist/modules/tools/builtin/read_file.d.ts +0 -3
- package/dist/modules/tools/builtin/read_file.d.ts.map +0 -1
- package/dist/modules/tools/builtin/read_file.js +0 -107
- package/dist/modules/tools/builtin/read_file.js.map +0 -1
- package/dist/modules/tools/builtin/read_file.txt +0 -38
- package/dist/modules/tools/builtin/todo_read.d.ts +0 -6
- package/dist/modules/tools/builtin/todo_read.d.ts.map +0 -1
- package/dist/modules/tools/builtin/todo_read.js +0 -25
- package/dist/modules/tools/builtin/todo_read.js.map +0 -1
- package/dist/modules/tools/builtin/todo_read.txt +0 -34
- package/dist/modules/tools/builtin/todo_write.d.ts +0 -6
- package/dist/modules/tools/builtin/todo_write.d.ts.map +0 -1
- package/dist/modules/tools/builtin/todo_write.js +0 -46
- package/dist/modules/tools/builtin/todo_write.js.map +0 -1
- package/dist/modules/tools/builtin/todo_write.txt +0 -67
- package/dist/modules/tools/builtin/web_fetch.d.ts +0 -3
- package/dist/modules/tools/builtin/web_fetch.d.ts.map +0 -1
- package/dist/modules/tools/builtin/web_fetch.js +0 -52
- package/dist/modules/tools/builtin/web_fetch.js.map +0 -1
- package/dist/modules/tools/builtin/web_fetch.txt +0 -38
- package/dist/modules/tools/builtin/web_search.d.ts +0 -3
- package/dist/modules/tools/builtin/web_search.d.ts.map +0 -1
- package/dist/modules/tools/builtin/web_search.js +0 -100
- package/dist/modules/tools/builtin/web_search.js.map +0 -1
- package/dist/modules/tools/builtin/web_search.txt +0 -43
- package/dist/modules/tools/builtin/write-file.tool.d.ts +0 -6
- package/dist/modules/tools/builtin/write-file.tool.d.ts.map +0 -1
- package/dist/modules/tools/builtin/write-file.tool.js +0 -38
- package/dist/modules/tools/builtin/write-file.tool.js.map +0 -1
- package/dist/modules/tools/builtin/write_file.d.ts +0 -3
- package/dist/modules/tools/builtin/write_file.d.ts.map +0 -1
- package/dist/modules/tools/builtin/write_file.js +0 -61
- package/dist/modules/tools/builtin/write_file.js.map +0 -1
- package/dist/modules/tools/builtin/write_file.txt +0 -58
- package/dist/modules/tools/provider/openai/tools.d.ts +0 -3
- package/dist/modules/tools/provider/openai/tools.d.ts.map +0 -1
- package/dist/modules/tools/provider/openai/tools.js +0 -212
- package/dist/modules/tools/provider/openai/tools.js.map +0 -1
- package/dist/modules/tools/provider/skill.d.ts +0 -6
- package/dist/modules/tools/provider/skill.d.ts.map +0 -1
- package/dist/modules/tools/provider/skill.js +0 -64
- package/dist/modules/tools/provider/skill.js.map +0 -1
- package/web/dist/assets/PcLayout-L-XuK1oQ.css +0 -1
- package/web/dist/assets/deployView-hCh3_M8H.css +0 -1
- package/web/dist/assets/designView-CqZ75hOS.css +0 -1
- package/web/dist/assets/designView-DrUNRVEE.js +0 -18
- package/web/dist/assets/devWorkflowView-BpdJTMEb.js +0 -36
- package/web/dist/assets/devWorkflowView-D7EKjoLj.css +0 -1
- package/web/dist/assets/devWorkflowViewApp-BYYMIdCm.css +0 -1
- package/web/dist/assets/gitChanges-BYj-Y2K-.css +0 -1
- package/web/dist/assets/gitChangesApp-Btw-XKcP.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/javascript-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/javascript-B4ku8P1-.js","assets/typescript-CmEn-k1B.js","assets/gitChangesApp-ZI7-V8oB.js","assets/ConfirmDialog-B03GcCHQ.js","assets/gitChangesApp-Bjn-MCmr.css","assets/devWorkflowViewApp-DLslXEq9.js","assets/devWorkflowViewApp-CErbhC2s.css","assets/PcLayout-ZTdJNg7G.js","assets/PcLayout-CYW3zqcs.css","assets/terminalView-GTYtDlus.js","assets/terminalView-eZ0agsPP.css","assets/devWorkflowView-BTozmaiN.js","assets/mediaChat-RT7iqqYb.js","assets/devWorkflowView-DYhIfbCB.css","assets/gitChanges-DFRvzL5I.js","assets/gitChanges-D6QxPcii.css","assets/wikiView-CRjg-cZ8.js","assets/wikiView-C-oqMnJM.css","assets/deployView-Cj51_Job.js","assets/deployView-CD7ji9IS.css","assets/designView-RT8tKEN9.js","assets/designView-C3pSX4nP.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
var _De=Object.defineProperty;var vDe=(s,e,t)=>e in s?_De(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var ui=(s,e,t)=>vDe(s,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(n){if(n.ep)return;n.ep=!0;const r=t(n);fetch(n.href,r)}})();var bDe={};/*!
|
|
3
3
|
* Vue.js v2.7.16
|
|
4
4
|
* (c) 2014-2023 Evan You
|
|
@@ -139,7 +139,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
139
139
|
* vue-router v3.6.5
|
|
140
140
|
* (c) 2022 Evan You
|
|
141
141
|
* @license MIT
|
|
142
|
-
*/function Cu(s,e){for(var t in e)s[t]=e[t];return s}var yOe=/[!'()*]/g,wOe=function(s){return"%"+s.charCodeAt(0).toString(16)},SOe=/%2C/g,b1=function(s){return encodeURIComponent(s).replace(yOe,wOe).replace(SOe,",")};function bU(s){try{return decodeURIComponent(s)}catch{}return s}function xOe(s,e,t){e===void 0&&(e={});var i=t||kOe,n;try{n=i(s||"")}catch{n={}}for(var r in e){var o=e[r];n[r]=Array.isArray(o)?o.map(Ole):Ole(o)}return n}var Ole=function(s){return s==null||typeof s=="object"?s:String(s)};function kOe(s){var e={};return s=s.trim().replace(/^(\?|#|&)/,""),s&&s.split("&").forEach(function(t){var i=t.replace(/\+/g," ").split("="),n=bU(i.shift()),r=i.length>0?bU(i.join("=")):null;e[n]===void 0?e[n]=r:Array.isArray(e[n])?e[n].push(r):e[n]=[e[n],r]}),e}function LOe(s){var e=s?Object.keys(s).map(function(t){var i=s[t];if(i===void 0)return"";if(i===null)return b1(t);if(Array.isArray(i)){var n=[];return i.forEach(function(r){r!==void 0&&(r===null?n.push(b1(t)):n.push(b1(t)+"="+b1(r)))}),n.join("&")}return b1(t)+"="+b1(i)}).filter(function(t){return t.length>0}).join("&"):null;return e?"?"+e:""}var XF=/\/?$/;function QF(s,e,t,i){var n=i&&i.options.stringifyQuery,r=e.query||{};try{r=CU(r)}catch{}var o={name:e.name||s&&s.name,meta:s&&s.meta||{},path:e.path||"/",hash:e.hash||"",query:r,params:e.params||{},fullPath:Ale(e,n),matched:s?DOe(s):[]};return t&&(o.redirectedFrom=Ale(t,n)),Object.freeze(o)}function CU(s){if(Array.isArray(s))return s.map(CU);if(s&&typeof s=="object"){var e={};for(var t in s)e[t]=CU(s[t]);return e}else return s}var x_=QF(null,{path:"/"});function DOe(s){for(var e=[];s;)e.unshift(s),s=s.parent;return e}function Ale(s,e){var t=s.path,i=s.query;i===void 0&&(i={});var n=s.hash;n===void 0&&(n="");var r=e||LOe;return(t||"/")+r(i)+n}function O_e(s,e,t){return e===x_?s===e:e?s.path&&e.path?s.path.replace(XF,"")===e.path.replace(XF,"")&&(t||s.hash===e.hash&&$2(s.query,e.query)):s.name&&e.name?s.name===e.name&&(t||s.hash===e.hash&&$2(s.query,e.query)&&$2(s.params,e.params)):!1:!1}function $2(s,e){if(s===void 0&&(s={}),e===void 0&&(e={}),!s||!e)return s===e;var t=Object.keys(s).sort(),i=Object.keys(e).sort();return t.length!==i.length?!1:t.every(function(n,r){var o=s[n],a=i[r];if(a!==n)return!1;var l=e[n];return o==null||l==null?o===l:typeof o=="object"&&typeof l=="object"?$2(o,l):String(o)===String(l)})}function IOe(s,e){return s.path.replace(XF,"/").indexOf(e.path.replace(XF,"/"))===0&&(!e.hash||s.hash===e.hash)&&EOe(s.query,e.query)}function EOe(s,e){for(var t in e)if(!(t in s))return!1;return!0}function A_e(s){for(var e=0;e<s.matched.length;e++){var t=s.matched[e];for(var i in t.instances){var n=t.instances[i],r=t.enteredCbs[i];if(!(!n||!r)){delete t.enteredCbs[i];for(var o=0;o<r.length;o++)n._isBeingDestroyed||r[o](n)}}}}var TOe={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render:function(e,t){var i=t.props,n=t.children,r=t.parent,o=t.data;o.routerView=!0;for(var a=r.$createElement,l=i.name,d=r.$route,h=r._routerViewCache||(r._routerViewCache={}),f=0,p=!1;r&&r._routerRoot!==r;){var m=r.$vnode?r.$vnode.data:{};m.routerView&&f++,m.keepAlive&&r._directInactive&&r._inactive&&(p=!0),r=r.$parent}if(o.routerViewDepth=f,p){var v=h[l],b=v&&v.component;return b?(v.configProps&&Fle(b,o,v.route,v.configProps),a(b,o,n)):a()}var y=d.matched[f],x=y&&y.components[l];if(!y||!x)return h[l]=null,a();h[l]={component:x},o.registerRouteInstance=function(S,I){var E=y.instances[l];(I&&E!==S||!I&&E===S)&&(y.instances[l]=I)},(o.hook||(o.hook={})).prepatch=function(S,I){y.instances[l]=I.componentInstance},o.hook.init=function(S){S.data.keepAlive&&S.componentInstance&&S.componentInstance!==y.instances[l]&&(y.instances[l]=S.componentInstance),A_e(d)};var D=y.props&&y.props[l];return D&&(Cu(h[l],{route:d,configProps:D}),Fle(x,o,d,D)),a(x,o,n)}};function Fle(s,e,t,i){var n=e.props=NOe(t,i);if(n){n=e.props=Cu({},n);var r=e.attrs=e.attrs||{};for(var o in n)(!s.props||!(o in s.props))&&(r[o]=n[o],delete n[o])}}function NOe(s,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(s);case"boolean":return e?s.params:void 0}}function F_e(s,e,t){var i=s.charAt(0);if(i==="/")return s;if(i==="?"||i==="#")return e+s;var n=e.split("/");(!t||!n[n.length-1])&&n.pop();for(var r=s.replace(/^\//,"").split("/"),o=0;o<r.length;o++){var a=r[o];a===".."?n.pop():a!=="."&&n.push(a)}return n[0]!==""&&n.unshift(""),n.join("/")}function MOe(s){var e="",t="",i=s.indexOf("#");i>=0&&(e=s.slice(i),s=s.slice(0,i));var n=s.indexOf("?");return n>=0&&(t=s.slice(n+1),s=s.slice(0,n)),{path:s,query:t,hash:e}}function wm(s){return s.replace(/\/(?:\s*\/)+/g,"/")}var JF=Array.isArray||function(s){return Object.prototype.toString.call(s)=="[object Array]"},xx=V_e,ROe=XJ,POe=BOe,OOe=B_e,AOe=W_e,FOe=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function XJ(s,e){for(var t=[],i=0,n=0,r="",o=e&&e.delimiter||"/",a;(a=FOe.exec(s))!=null;){var l=a[0],d=a[1],h=a.index;if(r+=s.slice(n,h),n=h+l.length,d){r+=d[1];continue}var f=s[n],p=a[2],m=a[3],v=a[4],b=a[5],y=a[6],x=a[7];r&&(t.push(r),r="");var D=p!=null&&f!=null&&f!==p,S=y==="+"||y==="*",I=y==="?"||y==="*",E=a[2]||o,R=v||b;t.push({name:m||i++,prefix:p||"",delimiter:E,optional:I,repeat:S,partial:D,asterisk:!!x,pattern:R?HOe(R):x?".*":"[^"+z2(E)+"]+?"})}return n<s.length&&(r+=s.substr(n)),r&&t.push(r),t}function BOe(s,e){return B_e(XJ(s,e),e)}function WOe(s){return encodeURI(s).replace(/[\/?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function VOe(s){return encodeURI(s).replace(/[?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function B_e(s,e){for(var t=new Array(s.length),i=0;i<s.length;i++)typeof s[i]=="object"&&(t[i]=new RegExp("^(?:"+s[i].pattern+")$",JJ(e)));return function(n,r){for(var o="",a=n||{},l=r||{},d=l.pretty?WOe:encodeURIComponent,h=0;h<s.length;h++){var f=s[h];if(typeof f=="string"){o+=f;continue}var p=a[f.name],m;if(p==null)if(f.optional){f.partial&&(o+=f.prefix);continue}else throw new TypeError('Expected "'+f.name+'" to be defined');if(JF(p)){if(!f.repeat)throw new TypeError('Expected "'+f.name+'" to not repeat, but received `'+JSON.stringify(p)+"`");if(p.length===0){if(f.optional)continue;throw new TypeError('Expected "'+f.name+'" to not be empty')}for(var v=0;v<p.length;v++){if(m=d(p[v]),!t[h].test(m))throw new TypeError('Expected all "'+f.name+'" to match "'+f.pattern+'", but received `'+JSON.stringify(m)+"`");o+=(v===0?f.prefix:f.delimiter)+m}continue}if(m=f.asterisk?VOe(p):d(p),!t[h].test(m))throw new TypeError('Expected "'+f.name+'" to match "'+f.pattern+'", but received "'+m+'"');o+=f.prefix+m}return o}}function z2(s){return s.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function HOe(s){return s.replace(/([=!:$\/()])/g,"\\$1")}function QJ(s,e){return s.keys=e,s}function JJ(s){return s&&s.sensitive?"":"i"}function $Oe(s,e){var t=s.source.match(/\((?!\?)/g);if(t)for(var i=0;i<t.length;i++)e.push({name:i,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return QJ(s,e)}function zOe(s,e,t){for(var i=[],n=0;n<s.length;n++)i.push(V_e(s[n],e,t).source);var r=new RegExp("(?:"+i.join("|")+")",JJ(t));return QJ(r,e)}function jOe(s,e,t){return W_e(XJ(s,t),e,t)}function W_e(s,e,t){JF(e)||(t=e||t,e=[]),t=t||{};for(var i=t.strict,n=t.end!==!1,r="",o=0;o<s.length;o++){var a=s[o];if(typeof a=="string")r+=z2(a);else{var l=z2(a.prefix),d="(?:"+a.pattern+")";e.push(a),a.repeat&&(d+="(?:"+l+d+")*"),a.optional?a.partial?d=l+"("+d+")?":d="(?:"+l+"("+d+"))?":d=l+"("+d+")",r+=d}}var h=z2(t.delimiter||"/"),f=r.slice(-h.length)===h;return i||(r=(f?r.slice(0,-h.length):r)+"(?:"+h+"(?=$))?"),n?r+="$":r+=i&&f?"":"(?="+h+"|$)",QJ(new RegExp("^"+r,JJ(t)),e)}function V_e(s,e,t){return JF(e)||(t=e||t,e=[]),t=t||{},s instanceof RegExp?$Oe(s,e):JF(s)?zOe(s,e,t):jOe(s,e,t)}xx.parse=ROe;xx.compile=POe;xx.tokensToFunction=OOe;xx.tokensToRegExp=AOe;var Ble=Object.create(null);function j2(s,e,t){e=e||{};try{var i=Ble[s]||(Ble[s]=xx.compile(s));return typeof e.pathMatch=="string"&&(e[0]=e.pathMatch),i(e,{pretty:!0})}catch{return""}finally{delete e[0]}}function eee(s,e,t,i){var n=typeof s=="string"?{path:s}:s;if(n._normalized)return n;if(n.name){n=Cu({},s);var r=n.params;return r&&typeof r=="object"&&(n.params=Cu({},r)),n}if(!n.path&&n.params&&e){n=Cu({},n),n._normalized=!0;var o=Cu(Cu({},e.params),n.params);if(e.name)n.name=e.name,n.params=o;else if(e.matched.length){var a=e.matched[e.matched.length-1].path;n.path=j2(a,o,"path "+e.path)}return n}var l=MOe(n.path||""),d=e&&e.path||"/",h=l.path?F_e(l.path,d,t||n.append):d,f=xOe(l.query,n.query,i&&i.options.parseQuery),p=n.hash||l.hash;return p&&p.charAt(0)!=="#"&&(p="#"+p),{_normalized:!0,path:h,query:f,hash:p}}var UOe=[String,Object],qOe=[String,Array],Wle=function(){},KOe={name:"RouterLink",props:{to:{type:UOe,required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:qOe,default:"click"}},render:function(e){var t=this,i=this.$router,n=this.$route,r=i.resolve(this.to,n,this.append),o=r.location,a=r.route,l=r.href,d={},h=i.options.linkActiveClass,f=i.options.linkExactActiveClass,p=h??"router-link-active",m=f??"router-link-exact-active",v=this.activeClass==null?p:this.activeClass,b=this.exactActiveClass==null?m:this.exactActiveClass,y=a.redirectedFrom?QF(null,eee(a.redirectedFrom),null,i):a;d[b]=O_e(n,y,this.exactPath),d[v]=this.exact||this.exactPath?d[b]:IOe(n,y);var x=d[b]?this.ariaCurrentValue:null,D=function(z){Vle(z)&&(t.replace?i.replace(o,Wle):i.push(o,Wle))},S={click:Vle};Array.isArray(this.event)?this.event.forEach(function(z){S[z]=D}):S[this.event]=D;var I={class:d},E=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:l,route:a,navigate:D,isActive:d[v],isExactActive:d[b]});if(E){if(E.length===1)return E[0];if(E.length>1||!E.length)return E.length===0?e():e("span",{},E)}if(this.tag==="a")I.on=S,I.attrs={href:l,"aria-current":x};else{var R=H_e(this.$slots.default);if(R){R.isStatic=!1;var M=R.data=Cu({},R.data);M.on=M.on||{};for(var O in M.on){var V=M.on[O];O in S&&(M.on[O]=Array.isArray(V)?V:[V])}for(var te in S)te in M.on?M.on[te].push(S[te]):M.on[te]=D;var J=R.data.attrs=Cu({},R.data.attrs);J.href=l,J["aria-current"]=x}else I.on=S}return e(this.tag,I,this.$slots.default)}};function Vle(s){if(!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)&&!s.defaultPrevented&&!(s.button!==void 0&&s.button!==0)){if(s.currentTarget&&s.currentTarget.getAttribute){var e=s.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return s.preventDefault&&s.preventDefault(),!0}}function H_e(s){if(s){for(var e,t=0;t<s.length;t++)if(e=s[t],e.tag==="a"||e.children&&(e=H_e(e.children)))return e}}var e4;function yU(s){if(!(yU.installed&&e4===s)){yU.installed=!0,e4=s;var e=function(n){return n!==void 0},t=function(n,r){var o=n.$options._parentVnode;e(o)&&e(o=o.data)&&e(o=o.registerRouteInstance)&&o(n,r)};s.mixin({beforeCreate:function(){e(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),s.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,t(this,this)},destroyed:function(){t(this)}}),Object.defineProperty(s.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(s.prototype,"$route",{get:function(){return this._routerRoot._route}}),s.component("RouterView",TOe),s.component("RouterLink",KOe);var i=s.config.optionMergeStrategies;i.beforeRouteEnter=i.beforeRouteLeave=i.beforeRouteUpdate=i.created}}var cN=typeof window<"u";function vA(s,e,t,i,n){var r=e||[],o=t||Object.create(null),a=i||Object.create(null);s.forEach(function(h){wU(r,o,a,h,n)});for(var l=0,d=r.length;l<d;l++)r[l]==="*"&&(r.push(r.splice(l,1)[0]),d--,l--);return{pathList:r,pathMap:o,nameMap:a}}function wU(s,e,t,i,n,r){var o=i.path,a=i.name,l=i.pathToRegexpOptions||{},d=YOe(o,n,l.strict);typeof i.caseSensitive=="boolean"&&(l.sensitive=i.caseSensitive);var h={path:d,regex:GOe(d,l),components:i.components||{default:i.component},alias:i.alias?typeof i.alias=="string"?[i.alias]:i.alias:[],instances:{},enteredCbs:{},name:a,parent:n,matchAs:r,redirect:i.redirect,beforeEnter:i.beforeEnter,meta:i.meta||{},props:i.props==null?{}:i.components?i.props:{default:i.props}};if(i.children&&i.children.forEach(function(b){var y=r?wm(r+"/"+b.path):void 0;wU(s,e,t,b,h,y)}),e[h.path]||(s.push(h.path),e[h.path]=h),i.alias!==void 0)for(var f=Array.isArray(i.alias)?i.alias:[i.alias],p=0;p<f.length;++p){var m=f[p],v={path:m,children:i.children};wU(s,e,t,v,n,h.path||"/")}a&&(t[a]||(t[a]=h))}function GOe(s,e){var t=xx(s,[],e);return t}function YOe(s,e,t){return t||(s=s.replace(/\/$/,"")),s[0]==="/"||e==null?s:wm(e.path+"/"+s)}function ZOe(s,e){var t=vA(s),i=t.pathList,n=t.pathMap,r=t.nameMap;function o(m){vA(m,i,n,r)}function a(m,v){var b=typeof m!="object"?r[m]:void 0;vA([v||m],i,n,r,b),b&&b.alias.length&&vA(b.alias.map(function(y){return{path:y,children:[v]}}),i,n,r,b)}function l(){return i.map(function(m){return n[m]})}function d(m,v,b){var y=eee(m,v,!1,e),x=y.name;if(x){var D=r[x];if(!D)return p(null,y);var S=D.regex.keys.filter(function(O){return!O.optional}).map(function(O){return O.name});if(typeof y.params!="object"&&(y.params={}),v&&typeof v.params=="object")for(var I in v.params)!(I in y.params)&&S.indexOf(I)>-1&&(y.params[I]=v.params[I]);return y.path=j2(D.path,y.params),p(D,y,b)}else if(y.path){y.params={};for(var E=0;E<i.length;E++){var R=i[E],M=n[R];if(XOe(M.regex,y.path,y.params))return p(M,y,b)}}return p(null,y)}function h(m,v){var b=m.redirect,y=typeof b=="function"?b(QF(m,v,null,e)):b;if(typeof y=="string"&&(y={path:y}),!y||typeof y!="object")return p(null,v);var x=y,D=x.name,S=x.path,I=v.query,E=v.hash,R=v.params;if(I=x.hasOwnProperty("query")?x.query:I,E=x.hasOwnProperty("hash")?x.hash:E,R=x.hasOwnProperty("params")?x.params:R,D)return r[D],d({_normalized:!0,name:D,query:I,hash:E,params:R},void 0,v);if(S){var M=QOe(S,m),O=j2(M,R);return d({_normalized:!0,path:O,query:I,hash:E},void 0,v)}else return p(null,v)}function f(m,v,b){var y=j2(b,v.params),x=d({_normalized:!0,path:y});if(x){var D=x.matched,S=D[D.length-1];return v.params=x.params,p(S,v)}return p(null,v)}function p(m,v,b){return m&&m.redirect?h(m,b||v):m&&m.matchAs?f(m,v,m.matchAs):QF(m,v,b,e)}return{match:d,addRoute:a,getRoutes:l,addRoutes:o}}function XOe(s,e,t){var i=e.match(s);if(i){if(!t)return!0}else return!1;for(var n=1,r=i.length;n<r;++n){var o=s.keys[n-1];o&&(t[o.name||"pathMatch"]=typeof i[n]=="string"?bU(i[n]):i[n])}return!0}function QOe(s,e){return F_e(s,e.parent?e.parent.path:"/",!0)}var JOe=cN&&window.performance&&window.performance.now?window.performance:Date;function $_e(){return JOe.now().toFixed(3)}var z_e=$_e();function uV(){return z_e}function j_e(s){return z_e=s}var U_e=Object.create(null);function q_e(){"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual");var s=window.location.protocol+"//"+window.location.host,e=window.location.href.replace(s,""),t=Cu({},window.history.state);return t.key=uV(),window.history.replaceState(t,"",e),window.addEventListener("popstate",Hle),function(){window.removeEventListener("popstate",Hle)}}function Sm(s,e,t,i){if(s.app){var n=s.options.scrollBehavior;n&&s.app.$nextTick(function(){var r=eAe(),o=n.call(s,e,t,i?r:null);o&&(typeof o.then=="function"?o.then(function(a){jle(a,r)}).catch(function(a){}):jle(o,r))})}}function K_e(){var s=uV();s&&(U_e[s]={x:window.pageXOffset,y:window.pageYOffset})}function Hle(s){K_e(),s.state&&s.state.key&&j_e(s.state.key)}function eAe(){var s=uV();if(s)return U_e[s]}function tAe(s,e){var t=document.documentElement,i=t.getBoundingClientRect(),n=s.getBoundingClientRect();return{x:n.left-i.left-e.x,y:n.top-i.top-e.y}}function $le(s){return IS(s.x)||IS(s.y)}function zle(s){return{x:IS(s.x)?s.x:window.pageXOffset,y:IS(s.y)?s.y:window.pageYOffset}}function iAe(s){return{x:IS(s.x)?s.x:0,y:IS(s.y)?s.y:0}}function IS(s){return typeof s=="number"}var nAe=/^#\d/;function jle(s,e){var t=typeof s=="object";if(t&&typeof s.selector=="string"){var i=nAe.test(s.selector)?document.getElementById(s.selector.slice(1)):document.querySelector(s.selector);if(i){var n=s.offset&&typeof s.offset=="object"?s.offset:{};n=iAe(n),e=tAe(i,n)}else $le(s)&&(e=zle(s))}else t&&$le(s)&&(e=zle(s));e&&("scrollBehavior"in document.documentElement.style?window.scrollTo({left:e.x,top:e.y,behavior:s.behavior}):window.scrollTo(e.x,e.y))}var xm=cN&&function(){var s=window.navigator.userAgent;return(s.indexOf("Android 2.")!==-1||s.indexOf("Android 4.0")!==-1)&&s.indexOf("Mobile Safari")!==-1&&s.indexOf("Chrome")===-1&&s.indexOf("Windows Phone")===-1?!1:window.history&&typeof window.history.pushState=="function"}();function t4(s,e){K_e();var t=window.history;try{if(e){var i=Cu({},t.state);i.key=uV(),t.replaceState(i,"",s)}else t.pushState({key:j_e($_e())},"",s)}catch{window.location[e?"replace":"assign"](s)}}function SU(s){t4(s,!0)}var Ey={redirected:2,aborted:4,cancelled:8,duplicated:16};function sAe(s,e){return hV(s,e,Ey.redirected,'Redirected when going from "'+s.fullPath+'" to "'+lAe(e)+'" via a navigation guard.')}function rAe(s,e){var t=hV(s,e,Ey.duplicated,'Avoided redundant navigation to current location: "'+s.fullPath+'".');return t.name="NavigationDuplicated",t}function Ule(s,e){return hV(s,e,Ey.cancelled,'Navigation cancelled from "'+s.fullPath+'" to "'+e.fullPath+'" with a new navigation.')}function oAe(s,e){return hV(s,e,Ey.aborted,'Navigation aborted from "'+s.fullPath+'" to "'+e.fullPath+'" via a navigation guard.')}function hV(s,e,t,i){var n=new Error(i);return n._isRouter=!0,n.from=s,n.to=e,n.type=t,n}var aAe=["params","query","hash"];function lAe(s){if(typeof s=="string")return s;if("path"in s)return s.path;var e={};return aAe.forEach(function(t){t in s&&(e[t]=s[t])}),JSON.stringify(e,null,2)}function i4(s){return Object.prototype.toString.call(s).indexOf("Error")>-1}function fV(s,e){return i4(s)&&s._isRouter&&(e==null||s.type===e)}function qle(s,e,t){var i=function(n){n>=s.length?t():s[n]?e(s[n],function(){i(n+1)}):i(n+1)};i(0)}function cAe(s){return function(e,t,i){var n=!1,r=0,o=null;G_e(s,function(a,l,d,h){if(typeof a=="function"&&a.cid===void 0){n=!0,r++;var f=Kle(function(b){uAe(b)&&(b=b.default),a.resolved=typeof b=="function"?b:e4.extend(b),d.components[h]=b,r--,r<=0&&i()}),p=Kle(function(b){var y="Failed to resolve async component "+h+": "+b;o||(o=i4(b)?b:new Error(y),i(o))}),m;try{m=a(f,p)}catch(b){p(b)}if(m)if(typeof m.then=="function")m.then(f,p);else{var v=m.component;v&&typeof v.then=="function"&&v.then(f,p)}}}),n||i()}}function G_e(s,e){return Y_e(s.map(function(t){return Object.keys(t.components).map(function(i){return e(t.components[i],t.instances[i],t,i)})}))}function Y_e(s){return Array.prototype.concat.apply([],s)}var dAe=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function uAe(s){return s.__esModule||dAe&&s[Symbol.toStringTag]==="Module"}function Kle(s){var e=!1;return function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];if(!e)return e=!0,s.apply(this,t)}}var zu=function(e,t){this.router=e,this.base=hAe(t),this.current=x_,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};zu.prototype.listen=function(e){this.cb=e};zu.prototype.onReady=function(e,t){this.ready?e():(this.readyCbs.push(e),t&&this.readyErrorCbs.push(t))};zu.prototype.onError=function(e){this.errorCbs.push(e)};zu.prototype.transitionTo=function(e,t,i){var n=this,r;try{r=this.router.match(e,this.current)}catch(a){throw this.errorCbs.forEach(function(l){l(a)}),a}var o=this.current;this.confirmTransition(r,function(){n.updateRoute(r),t&&t(r),n.ensureURL(),n.router.afterHooks.forEach(function(a){a&&a(r,o)}),n.ready||(n.ready=!0,n.readyCbs.forEach(function(a){a(r)}))},function(a){i&&i(a),a&&!n.ready&&(!fV(a,Ey.redirected)||o!==x_)&&(n.ready=!0,n.readyErrorCbs.forEach(function(l){l(a)}))})};zu.prototype.confirmTransition=function(e,t,i){var n=this,r=this.current;this.pending=e;var o=function(b){!fV(b)&&i4(b)&&(n.errorCbs.length?n.errorCbs.forEach(function(y){y(b)}):console.error(b)),i&&i(b)},a=e.matched.length-1,l=r.matched.length-1;if(O_e(e,r)&&a===l&&e.matched[a]===r.matched[l])return this.ensureURL(),e.hash&&Sm(this.router,r,e,!1),o(rAe(r,e));var d=fAe(this.current.matched,e.matched),h=d.updated,f=d.deactivated,p=d.activated,m=[].concat(pAe(f),this.router.beforeHooks,mAe(h),p.map(function(b){return b.beforeEnter}),cAe(p)),v=function(b,y){if(n.pending!==e)return o(Ule(r,e));try{b(e,r,function(x){x===!1?(n.ensureURL(!0),o(oAe(r,e))):i4(x)?(n.ensureURL(!0),o(x)):typeof x=="string"||typeof x=="object"&&(typeof x.path=="string"||typeof x.name=="string")?(o(sAe(r,e)),typeof x=="object"&&x.replace?n.replace(x):n.push(x)):y(x)})}catch(x){o(x)}};qle(m,v,function(){var b=_Ae(p),y=b.concat(n.router.resolveHooks);qle(y,v,function(){if(n.pending!==e)return o(Ule(r,e));n.pending=null,t(e),n.router.app&&n.router.app.$nextTick(function(){A_e(e)})})})};zu.prototype.updateRoute=function(e){this.current=e,this.cb&&this.cb(e)};zu.prototype.setupListeners=function(){};zu.prototype.teardown=function(){this.listeners.forEach(function(e){e()}),this.listeners=[],this.current=x_,this.pending=null};function hAe(s){if(!s)if(cN){var e=document.querySelector("base");s=e&&e.getAttribute("href")||"/",s=s.replace(/^https?:\/\/[^\/]+/,"")}else s="/";return s.charAt(0)!=="/"&&(s="/"+s),s.replace(/\/$/,"")}function fAe(s,e){var t,i=Math.max(s.length,e.length);for(t=0;t<i&&s[t]===e[t];t++);return{updated:e.slice(0,t),activated:e.slice(t),deactivated:s.slice(t)}}function tee(s,e,t,i){var n=G_e(s,function(r,o,a,l){var d=gAe(r,e);if(d)return Array.isArray(d)?d.map(function(h){return t(h,o,a,l)}):t(d,o,a,l)});return Y_e(i?n.reverse():n)}function gAe(s,e){return typeof s!="function"&&(s=e4.extend(s)),s.options[e]}function pAe(s){return tee(s,"beforeRouteLeave",Z_e,!0)}function mAe(s){return tee(s,"beforeRouteUpdate",Z_e)}function Z_e(s,e){if(e)return function(){return s.apply(e,arguments)}}function _Ae(s){return tee(s,"beforeRouteEnter",function(e,t,i,n){return vAe(e,i,n)})}function vAe(s,e,t){return function(n,r,o){return s(n,r,function(a){typeof a=="function"&&(e.enteredCbs[t]||(e.enteredCbs[t]=[]),e.enteredCbs[t].push(a)),o(a)})}}var X_e=function(s){function e(t,i){s.call(this,t,i),this._startLocation=TD(this.base)}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var i=this;if(!(this.listeners.length>0)){var n=this.router,r=n.options.scrollBehavior,o=xm&&r;o&&this.listeners.push(q_e());var a=function(){var l=i.current,d=TD(i.base);i.current===x_&&d===i._startLocation||i.transitionTo(d,function(h){o&&Sm(n,h,l,!0)})};window.addEventListener("popstate",a),this.listeners.push(function(){window.removeEventListener("popstate",a)})}},e.prototype.go=function(i){window.history.go(i)},e.prototype.push=function(i,n,r){var o=this,a=this,l=a.current;this.transitionTo(i,function(d){t4(wm(o.base+d.fullPath)),Sm(o.router,d,l,!1),n&&n(d)},r)},e.prototype.replace=function(i,n,r){var o=this,a=this,l=a.current;this.transitionTo(i,function(d){SU(wm(o.base+d.fullPath)),Sm(o.router,d,l,!1),n&&n(d)},r)},e.prototype.ensureURL=function(i){if(TD(this.base)!==this.current.fullPath){var n=wm(this.base+this.current.fullPath);i?t4(n):SU(n)}},e.prototype.getCurrentLocation=function(){return TD(this.base)},e}(zu);function TD(s){var e=window.location.pathname,t=e.toLowerCase(),i=s.toLowerCase();return s&&(t===i||t.indexOf(wm(i+"/"))===0)&&(e=e.slice(s.length)),(e||"/")+window.location.search+window.location.hash}var Q_e=function(s){function e(t,i,n){s.call(this,t,i),!(n&&bAe(this.base))&&Gle()}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var i=this;if(!(this.listeners.length>0)){var n=this.router,r=n.options.scrollBehavior,o=xm&&r;o&&this.listeners.push(q_e());var a=function(){var d=i.current;Gle()&&i.transitionTo(U2(),function(h){o&&Sm(i.router,h,d,!0),xm||q2(h.fullPath)})},l=xm?"popstate":"hashchange";window.addEventListener(l,a),this.listeners.push(function(){window.removeEventListener(l,a)})}},e.prototype.push=function(i,n,r){var o=this,a=this,l=a.current;this.transitionTo(i,function(d){Yle(d.fullPath),Sm(o.router,d,l,!1),n&&n(d)},r)},e.prototype.replace=function(i,n,r){var o=this,a=this,l=a.current;this.transitionTo(i,function(d){q2(d.fullPath),Sm(o.router,d,l,!1),n&&n(d)},r)},e.prototype.go=function(i){window.history.go(i)},e.prototype.ensureURL=function(i){var n=this.current.fullPath;U2()!==n&&(i?Yle(n):q2(n))},e.prototype.getCurrentLocation=function(){return U2()},e}(zu);function bAe(s){var e=TD(s);if(!/^\/#/.test(e))return window.location.replace(wm(s+"/#"+e)),!0}function Gle(){var s=U2();return s.charAt(0)==="/"?!0:(q2("/"+s),!1)}function U2(){var s=window.location.href,e=s.indexOf("#");return e<0?"":(s=s.slice(e+1),s)}function xU(s){var e=window.location.href,t=e.indexOf("#"),i=t>=0?e.slice(0,t):e;return i+"#"+s}function Yle(s){xm?t4(xU(s)):window.location.hash=s}function q2(s){xm?SU(xU(s)):window.location.replace(xU(s))}var CAe=function(s){function e(t,i){s.call(this,t,i),this.stack=[],this.index=-1}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.push=function(i,n,r){var o=this;this.transitionTo(i,function(a){o.stack=o.stack.slice(0,o.index+1).concat(a),o.index++,n&&n(a)},r)},e.prototype.replace=function(i,n,r){var o=this;this.transitionTo(i,function(a){o.stack=o.stack.slice(0,o.index).concat(a),n&&n(a)},r)},e.prototype.go=function(i){var n=this,r=this.index+i;if(!(r<0||r>=this.stack.length)){var o=this.stack[r];this.confirmTransition(o,function(){var a=n.current;n.index=r,n.updateRoute(o),n.router.afterHooks.forEach(function(l){l&&l(o,a)})},function(a){fV(a,Ey.duplicated)&&(n.index=r)})}},e.prototype.getCurrentLocation=function(){var i=this.stack[this.stack.length-1];return i?i.fullPath:"/"},e.prototype.ensureURL=function(){},e}(zu),Ps=function(e){e===void 0&&(e={}),this.app=null,this.apps=[],this.options=e,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=ZOe(e.routes||[],this);var t=e.mode||"hash";switch(this.fallback=t==="history"&&!xm&&e.fallback!==!1,this.fallback&&(t="hash"),cN||(t="abstract"),this.mode=t,t){case"history":this.history=new X_e(this,e.base);break;case"hash":this.history=new Q_e(this,e.base,this.fallback);break;case"abstract":this.history=new CAe(this,e.base);break}},J_e={currentRoute:{configurable:!0}};Ps.prototype.match=function(e,t,i){return this.matcher.match(e,t,i)};J_e.currentRoute.get=function(){return this.history&&this.history.current};Ps.prototype.init=function(e){var t=this;if(this.apps.push(e),e.$once("hook:destroyed",function(){var o=t.apps.indexOf(e);o>-1&&t.apps.splice(o,1),t.app===e&&(t.app=t.apps[0]||null),t.app||t.history.teardown()}),!this.app){this.app=e;var i=this.history;if(i instanceof X_e||i instanceof Q_e){var n=function(o){var a=i.current,l=t.options.scrollBehavior,d=xm&&l;d&&"fullPath"in o&&Sm(t,o,a,!1)},r=function(o){i.setupListeners(),n(o)};i.transitionTo(i.getCurrentLocation(),r,r)}i.listen(function(o){t.apps.forEach(function(a){a._route=o})})}};Ps.prototype.beforeEach=function(e){return iee(this.beforeHooks,e)};Ps.prototype.beforeResolve=function(e){return iee(this.resolveHooks,e)};Ps.prototype.afterEach=function(e){return iee(this.afterHooks,e)};Ps.prototype.onReady=function(e,t){this.history.onReady(e,t)};Ps.prototype.onError=function(e){this.history.onError(e)};Ps.prototype.push=function(e,t,i){var n=this;if(!t&&!i&&typeof Promise<"u")return new Promise(function(r,o){n.history.push(e,r,o)});this.history.push(e,t,i)};Ps.prototype.replace=function(e,t,i){var n=this;if(!t&&!i&&typeof Promise<"u")return new Promise(function(r,o){n.history.replace(e,r,o)});this.history.replace(e,t,i)};Ps.prototype.go=function(e){this.history.go(e)};Ps.prototype.back=function(){this.go(-1)};Ps.prototype.forward=function(){this.go(1)};Ps.prototype.getMatchedComponents=function(e){var t=e?e.matched?e:this.resolve(e).route:this.currentRoute;return t?[].concat.apply([],t.matched.map(function(i){return Object.keys(i.components).map(function(n){return i.components[n]})})):[]};Ps.prototype.resolve=function(e,t,i){t=t||this.history.current;var n=eee(e,t,i,this),r=this.match(n,t),o=r.redirectedFrom||r.fullPath,a=this.history.base,l=yAe(a,o,this.mode);return{location:n,route:r,href:l,normalizedTo:n,resolved:r}};Ps.prototype.getRoutes=function(){return this.matcher.getRoutes()};Ps.prototype.addRoute=function(e,t){this.matcher.addRoute(e,t),this.history.current!==x_&&this.history.transitionTo(this.history.getCurrentLocation())};Ps.prototype.addRoutes=function(e){this.matcher.addRoutes(e),this.history.current!==x_&&this.history.transitionTo(this.history.getCurrentLocation())};Object.defineProperties(Ps.prototype,J_e);var eve=Ps;function iee(s,e){return s.push(e),function(){var t=s.indexOf(e);t>-1&&s.splice(t,1)}}function yAe(s,e,t){var i=t==="hash"?"#"+e:e;return s?wm(s+"/"+i):i}Ps.install=yU;Ps.version="3.6.5";Ps.isNavigationFailure=fV;Ps.NavigationFailureType=Ey;Ps.START_LOCATION=x_;cN&&window.Vue&&window.Vue.use(Ps);const wAe={name:"SessionsSidebar",props:{sessions:{type:Array,default:()=>[]},currentSessionId:{type:String,default:null},hasMore:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1}},methods:{formatTime(s){if(!s)return"";const e=new Date(s),t=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0"),n=String(e.getHours()).padStart(2,"0"),r=String(e.getMinutes()).padStart(2,"0");return`${t}-${i} ${n}:${r}`}}};var SAe=function(){var e=this,t=e._self._c;return t("aside",{staticClass:"sidebar"},[t("div",{staticClass:"sidebar-header"},[t("div",{staticClass:"sidebar-title"},[e._v("会话列表")]),t("el-button",{staticClass:"new-btn",attrs:{type:"primary",size:"small"},on:{click:function(i){return e.$emit("create")}}},[e._v(" + 新建 ")])],1),t("div",{staticClass:"sidebar-content"},[e._l(e.sessions,function(i){return t("div",{key:i.id,staticClass:"session-item",class:{active:e.currentSessionId===i.id},attrs:{draggable:"true"},on:{dragstart:function(n){return e.$emit("dragstart",n,i)},click:function(n){return e.$emit("select",i)}}},[t("div",{staticClass:"session-row"},[t("span",{staticClass:"session-title truncate"},[e._v(e._s(i.title||"新会话"))]),t("span",{staticClass:"session-time"},[e._v(e._s(e.formatTime(i.createdAt)))]),t("div",{staticClass:"session-actions",on:{click:function(n){n.stopPropagation()}}},[t("el-dropdown",{attrs:{trigger:"click"},on:{command:n=>e.$emit("command",n,i)}},[t("span",{staticClass:"action-btn"},[e._v("⋮")]),t("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t("el-dropdown-item",{attrs:{command:"rename"}},[e._v("重命名")]),t("el-dropdown-item",{attrs:{command:"delete",divided:""}},[e._v("删除")])],1)],1)],1)])])}),e.hasMore?t("div",{staticClass:"load-more",on:{click:function(i){return e.$emit("loadmore")}}},[t("el-button",{attrs:{size:"small",loading:e.loadingMore}},[e._v("加载更多")])],1):e._e()],2)])},xAe=[],kAe=en(wAe,SAe,xAe,!1,null,"4e3004bd");const LAe=kAe.exports,DAe={name:"FileSelectTreeNode",props:{node:{type:Object,required:!0},level:{type:Number,default:0},selectedPath:{type:String,default:""}},data(){return{expanded:!1,loading:!1,loadedChildren:this.node.children||[]}},computed:{isSelected(){return this.selectedPath===this.node.path}},watch:{node:{immediate:!0,handler(s){s.children&&s.children.length>0&&(this.loadedChildren=s.children)}}},methods:{async toggleExpand(){if(this.node.is_directory)if(!this.expanded&&this.loadedChildren.length===0&&this.node.has_children){this.loading=!0;try{this.$emit("load-children",{path:this.node.path,callback:s=>{this.loadedChildren=s,this.expanded=!0,this.loading=!1}})}catch(s){console.error("Failed to load children:",s),this.loading=!1}}else this.expanded=!this.expanded},handleClick(){this.$emit("select",this.node),this.node.is_directory&&this.toggleExpand()},handleDblClick(){},getFileIcon(s,e){if(e)return"fa-solid fa-folder text-yellow-500";const t=s.split(".").pop().toLowerCase(),i=s.toLowerCase(),n={js:"fa-brands fa-js text-yellow-400",jsx:"fa-brands fa-react text-blue-400",ts:"fa-brands fa-js text-blue-400",tsx:"fa-brands fa-react text-blue-400",html:"fa-brands fa-html5 text-orange-500",htm:"fa-brands fa-html5 text-orange-500",css:"fa-brands fa-css3 text-blue-400",scss:"fa-brands fa-sass text-pink-400",sass:"fa-brands fa-sass text-pink-400",vue:"fa-brands fa-vuejs text-green-400",py:"fa-brands fa-python text-blue-500",pyc:"fa-brands fa-python text-gray-400",json:"fa-solid fa-file-code text-yellow-300",yaml:"fa-solid fa-file-code text-blue-300",yml:"fa-solid fa-file-code text-blue-300",xml:"fa-solid fa-file-code text-orange-300",md:"fa-solid fa-file-lines text-gray-400",markdown:"fa-solid fa-file-lines text-gray-400",sql:"fa-solid fa-database text-gray-400",sh:"fa-solid fa-terminal text-green-400",bash:"fa-solid fa-terminal text-green-400",go:"fa-brands fa-golang text-cyan-400",rs:"fa-brands fa-rust text-orange-400",java:"fa-brands fa-java text-red-400",kt:"fa-brands fa-android text-purple-400",swift:"fa-brands fa-apple text-blue-300",c:"fa-solid fa-file-code text-blue-300",cpp:"fa-solid fa-file-code text-blue-400",cc:"fa-solid fa-file-code text-blue-400",h:"fa-solid fa-file-code text-blue-300",hpp:"fa-solid fa-file-code text-blue-400",cs:"fa-brands fa-microsoft text-purple-400",rb:"fa-solid fa-gem text-red-400",php:"fa-brands fa-php text-purple-400",dockerfile:"fa-brands fa-docker text-blue-400",gitignore:"fa-brands fa-git text-red-400",gitattributes:"fa-brands fa-git text-red-400",license:"fa-solid fa-scale-balanced text-yellow-400",png:"fa-solid fa-image text-green-400",jpg:"fa-solid fa-image text-green-400",jpeg:"fa-solid fa-image text-green-400",gif:"fa-solid fa-image text-green-400",svg:"fa-solid fa-image text-green-400",ico:"fa-solid fa-image text-green-400",webp:"fa-solid fa-image text-green-400",bmp:"fa-solid fa-image text-green-400",mp4:"fa-solid fa-film text-purple-400",avi:"fa-solid fa-film text-purple-400",mov:"fa-solid fa-film text-purple-400",mkv:"fa-solid fa-film text-purple-400",mp3:"fa-solid fa-music text-pink-400",wav:"fa-solid fa-music text-pink-400",flac:"fa-solid fa-music text-pink-400",woff:"fa-solid fa-font text-blue-400",woff2:"fa-solid fa-font text-blue-400",ttf:"fa-solid fa-font text-blue-400",otf:"fa-solid fa-font text-blue-400",eot:"fa-solid fa-font text-blue-400",zip:"fa-solid fa-file-zipper text-yellow-600",rar:"fa-solid fa-file-zipper text-yellow-600","7z":"fa-solid fa-file-zipper text-yellow-600",tar:"fa-solid fa-file-zipper text-yellow-600",gz:"fa-solid fa-file-zipper text-yellow-600",pdf:"fa-solid fa-file-pdf text-red-500",doc:"fa-solid fa-file-word text-blue-600",docx:"fa-solid fa-file-word text-blue-600",xls:"fa-solid fa-file-excel text-green-600",xlsx:"fa-solid fa-file-excel text-green-600",ppt:"fa-solid fa-file-powerpoint text-orange-600",pptx:"fa-solid fa-file-powerpoint text-orange-600"};return i==="dockerfile"?n.dockerfile:i===".gitignore"?n.gitignore:i===".gitattributes"?n.gitattributes:i==="license"||i.startsWith("license")?n.license:i.startsWith("readme")?n.md:n[t]||"fa-solid fa-file text-gray-400"}}};var IAe=function(){var i;var e=this,t=e._self._c;return t("div",{staticClass:"file-tree-node"},[t("div",{staticClass:"node-content",class:{selected:e.isSelected,directory:e.node.is_directory},style:{paddingLeft:e.level*16+4+"px"},on:{click:e.handleClick,dblclick:e.handleDblClick}},[e.node.is_directory?t("span",{staticClass:"expand-icon",on:{click:function(n){return n.stopPropagation(),e.toggleExpand.apply(null,arguments)}}},[e.loading?t("i",{staticClass:"fa-solid fa-spinner fa-spin"}):e.expanded?t("i",{staticClass:"fa-solid fa-chevron-down"}):e.node.has_children||e.node.children&&e.node.children.length>0?t("i",{staticClass:"fa-solid fa-chevron-right"}):t("span",{staticClass:"placeholder"})]):t("span",{staticClass:"expand-icon placeholder"}),t("span",{staticClass:"node-icon"},[t("i",{class:e.getFileIcon(e.node.name,e.node.is_directory)})]),t("span",{staticClass:"node-name"},[e._v(e._s(e.node.name))])]),e.node.is_directory&&e.expanded&&(e.loadedChildren.length>0||((i=e.node.children)==null?void 0:i.length)>0)?t("div",{staticClass:"children"},e._l(e.loadedChildren.length>0?e.loadedChildren:e.node.children,function(n){return t("file-select-tree-node",{key:n.path,attrs:{node:n,level:e.level+1,"selected-path":e.selectedPath},on:{select:function(r){return e.$emit("select",r)},"enter-dir":function(r){return e.$emit("enter-dir",r)},"load-children":function(r){return e.$emit("load-children",r)}}})}),1):e._e()])},EAe=[],TAe=en(DAe,IAe,EAe,!1,null,"2dba2e74");const NAe=TAe.exports,MAe=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/code`;let rr=null,yg=null,K2=0;const RAe=10,PAe=1e3,iI=new Map;let bA=new Map,nI=null;const OAe=5e3;function AAe(s){return iI.has(s)||iI.set(s,[]),iI.get(s)}function FAe(s){const{type:e}=s,t=iI.get(e)||[];for(const i of t)try{i(s)}catch(n){console.error("WebSocket listener error:",n)}}function kU(){if(!(rr&&rr.readyState===WebSocket.OPEN))try{rr=new WebSocket(MAe),rr.onopen=()=>{console.log("[WS] Connected"),K2=0,yg&&(clearTimeout(yg),yg=null),WAe()},rr.onmessage=s=>{try{const e=JSON.parse(s.data);FAe(e)}catch(e){console.error("[WS] Parse error:",e)}},rr.onclose=()=>{console.log("[WS] Closed"),rr=null,tve(),Zle()},rr.onerror=s=>{console.error("[WS] Error:",s)}}catch(s){console.error("[WS] Connection error:",s),Zle()}}function Zle(){if(K2>=RAe){console.log("[WS] Max reconnect attempts reached");return}if(yg)return;const s=PAe*Math.pow(2,K2);K2++,yg=setTimeout(()=>{yg=null,kU()},s)}function BAe(){tve(),yg&&(clearTimeout(yg),yg=null),rr&&(rr.close(),rr=null)}function Xle(s,e){return rr&&rr.readyState===WebSocket.OPEN?(rr.send(JSON.stringify({type:s,data:e})),!0):!1}function Qle(){return rr&&rr.readyState===WebSocket.OPEN}function WAe(){nI||(nI=setInterval(()=>{rr&&rr.readyState===WebSocket.OPEN&&rr.send(JSON.stringify({type:"get_running_sessions",data:{}}))},OAe),rr&&rr.readyState===WebSocket.OPEN&&rr.send(JSON.stringify({type:"get_running_sessions",data:{}})))}function tve(){nI&&(clearInterval(nI),nI=null)}const Cd={connect:kU,disconnect:BAe,send:Xle,isConnected:Qle,on(s,e){const t=AAe(s);return t.push(e),()=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)}},off(s,e){const t=iI.get(s)||[],i=t.indexOf(e);i>-1&&t.splice(i,1)},subscribe(s,e){console.log(`[WS] Subscribing to session ${s} with handlers:`,Object.keys(e)),bA.has(s)&&bA.get(s)();const t=[],i=["todos","session","step","compact","done","stopped","error"],n=["running_sessions"];for(const o of i){const a=e[o];a&&t.push(this.on(o,l=>{var h;(l.sessionId||((h=l.data)==null?void 0:h.sessionId))===s&&a(l.data||l,l)}))}for(const o of n){const a=e[o];a&&t.push(this.on(o,l=>{a(l.data||l,l)}))}e.running_sessions&&Qle()&&Xle("get_running_sessions",{});const r=()=>{t.forEach(o=>o()),bA.delete(s)};return bA.set(s,r),r},init(){kU()}},Wv="/api";let Ep=new Map;async function Ye(s,e,t=null){const i={method:s,headers:{"Content-Type":"application/json"}};t&&s!=="GET"&&(i.body=JSON.stringify(t));const r=await(await fetch(`${Wv}${e}`,i)).json();if(r.success===!1)throw new Error(r.error||r.message||"请求失败");return r}const Yt={getSessions(s=20,e=0){return Ye("GET",`/session/list_session?limit=${s}&offset=${e}`)},createSession(s="新会话",e=null){return Ye("POST","/session/create_session",{title:s,projectPath:e})},getSession(s){return Ye("GET",`/session/detail_session?id=${s}`)},updateSession(s,e){return Ye("POST","/session/update_session",{id:s,...e})},deleteSession(s){return Ye("POST","/session/delete_session",{id:s})},getSessionStatuses(s){return Ye("POST","/session/status_session",{sessionIds:s})},getMessages(s){return Ye("GET",`/chat/history_chat?sessionId=${s}`)},getProviders(){return Ye("GET","/sys_config/list_providers_config")},getProvider(s){return Ye("GET",`/sys_config/detail_provider_config?id=${s}`)},addProvider(s){return Ye("POST","/sys_config/create_provider_config",s)},updateProvider(s,e){return Ye("POST","/sys_config/update_provider_config",{id:s,...e})},deleteProvider(s){return Ye("POST","/sys_config/delete_provider_config",{id:s})},setDefaultProvider(s){return Ye("POST","/sys_config/set_default_provider_config",{id:s})},getModels(){return Ye("GET","/sys_config/list_models_config")},getModelsByProvider(s){return Ye("GET",`/sys_config/list_models_config?providerId=${s}`)},addModel(s){return Ye("POST","/sys_config/create_model_config",s)},updateModel(s,e){return Ye("POST","/sys_config/update_model_config",{id:s,...e})},deleteModel(s){return Ye("POST","/sys_config/delete_model_config",{id:s})},chat(s){return Ye("POST","/chat/send_chat",s)},chatCommand(s,e){return Ye("POST","/chat/command_chat",{message:s,sessionId:e})},uploadChatImage(s,e){const t=new FormData;return t.append("image",s),t.append("sessionId",e),fetch(`${Wv}/chat/upload_image_chat`,{method:"POST",body:t}).then(i=>i.json())},getSkills(){return Ye("GET","/skill/list_skill")},getSkillRepositories(){return Ye("GET","/skill/repositories_skill")},createSkillRepository(s){return Ye("POST","/skill/create_repo_skill",s)},updateSkillRepository(s,e){return Ye("POST","/skill/update_repo_skill",{id:s,...e})},deleteSkillRepository(s){return Ye("POST","/skill/delete_repo_skill",{id:s})},syncSkillRepository(s){return Ye("POST","/skill/sync_repo_skill",{id:s})},getRemoteSkills(s){return Ye("GET",`/skill/repositories_skill?repoId=${s}`)},downloadSkill(s,e,t){return Ye("POST","/skill/download_repo_skill",{repoId:s,skillName:e,projectPath:t})},downloadAllSkills(s,e){return Ye("POST","/skill/download_repo_skill",{repoId:s,all:!0,projectPath:e})},getLocalSkills(s){const e=s?`?projectPath=${encodeURIComponent(s)}`:"";return Ye("GET",`/skill/local_skill${e}`)},getSkillContent(s){return Ye("GET",`/skill/detail_skill?name=${encodeURIComponent(s)}`)},deleteLocalSkill(s){return Ye("POST","/skill/load_skill",{name:s,action:"delete"})},getConfig(s){return Ye("GET",`/sys_config/get_config?key=${encodeURIComponent(s)}`)},setConfig(s,e){return Ye("POST","/sys_config/set_config",{key:s,value:e})},getProxyConfig(){return Ye("GET","/sys_config/proxy_config")},updateProxyConfig(s){return Ye("POST","/sys_config/proxy_config",s)},getFileTree(s="/"){return Ye("GET",`/file/tree_file?path=${encodeURIComponent(s)}`)},getFileContent(s){return Ye("GET",`/file/content_file?path=${encodeURIComponent(s)}`)},writeFile(s,e){return Ye("POST","/file/write_file",{path:s,content:e})},editFile(s,e,t){return Ye("POST","/file/edit_file",{path:s,oldString:e,newString:t})},deleteFile(s){return Ye("POST","/file/delete_file",{filePath:s})},writeFile(s,e){return Ye("POST","/file/write_file",{filePath:s,content:e})},editFile(s,e,t){return Ye("POST","/file/edit_file",{filePath:s,oldString:e,newString:t})},createDirectory(s){return Ye("POST","/file/mkdir_file",{filePath:s})},renameFile(s,e){return Ye("POST","/file/rename_file",{oldPath:s,newPath:e})},browseFilesystem(s=""){return Ye("GET",`/file/browse_file?path=${encodeURIComponent(s)}`)},async uploadFilesystem(s,e){const t=new FormData;t.append("file",e),t.append("targetDir",s),t.append("filename",encodeURIComponent(e.name));const n=await(await fetch(`${Wv}/file/upload_file`,{method:"POST",body:t})).json();if(n.success===!1)throw new Error(n.error||n.message||"上传失败");return n},uploadFilesystemWithProgress(s,e,t){const n=Math.ceil(e.size/10485760),r=Date.now()+"-"+Math.round(Math.random()*1e9);return(async()=>{for(let l=0;l<n;l++){const d=l*10485760,h=Math.min(d+10485760,e.size),f=e.slice(d,h);await this.uploadChunk(r,l,n,e.name,s,f),t&&t(Math.round((l+1)/n*95))}const a=await this.mergeChunks(r);return t&&t(100),a})()},uploadChunk(s,e,t,i,n,r){const o=new FormData;return o.append("uploadId",s),o.append("chunkIndex",String(e)),o.append("totalChunks",String(t)),o.append("fileName",encodeURIComponent(i)),o.append("targetDir",n),o.append("chunk",r),fetch(`${Wv}/file/upload_chunk_file`,{method:"POST",body:o}).then(a=>a.json()).then(a=>{if(a.success===!1)throw new Error(a.error||"上传分片失败");return a})},mergeChunks(s){return Ye("POST","/file/upload_merge_file",{uploadId:s})},downloadFilesystemWithProgress(s,e,t){const i=`${Wv}/file/download_file?path=${encodeURIComponent(s)}`;return fetch(i).then(n=>{if(!n.ok)throw new Error("下载失败: HTTP "+n.status);const r=n.headers.get("Content-Length"),o=r?parseInt(r,10):0,a=n.body.getReader(),l=[];let d=0;const h=()=>a.read().then(({done:f,value:p})=>{if(f){const m=new Blob(l),v=URL.createObjectURL(m),b=document.createElement("a");return b.href=v,b.download=e,document.body.appendChild(b),b.click(),document.body.removeChild(b),URL.revokeObjectURL(v),{success:!0}}return l.push(p),d+=p.length,o>0&&t&&t(Math.round(d/o*100)),h()});return h()})},async saveFile(s,e){return Ye("POST","/file/write_file",{filePath:s,content:Array.from(new Uint8Array(e))})},removeFile(s){return Ye("POST","/file/delete_file",{filePath:s})},moveFile(s,e){return Ye("POST","/file/rename_file",{oldPath:s,newPath:e})},getDrives(){return Ye("GET","/file/drives_file")},getCwd(){return Ye("GET","/file/browse_file?path=.")},getDbTables(){return Ye("GET","/db/tables_db")},getTableInfo(s){return Ye("GET",`/db/schema_db?name=${encodeURIComponent(s)}`)},getTableData(s,e=1,t=50){return Ye("GET",`/db/data_db?name=${encodeURIComponent(s)}&page=${e}&pageSize=${t}`)},getTableDataRaw(s,e=100){return Ye("GET",`/db/data_db?name=${encodeURIComponent(s)}&limit=${e}`)},executeSql(s){return Ye("POST","/db/data_db",{query:s})},getAiCallLogs(s=1,e=50){return Ye("GET",`/ai_log/list_ai_log?page=${s}&pageSize=${e}`)},getScheduledTasks(){return Ye("GET","/scheduler/list_scheduler")},getScheduledTask(s){return Ye("GET",`/scheduler/logs_scheduler?id=${s}`)},createScheduledTask(s){return Ye("POST","/scheduler/create_scheduler",s)},updateScheduledTask(s,e){return Ye("POST","/scheduler/update_scheduler",{id:s,...e})},deleteScheduledTask(s){return Ye("POST","/scheduler/delete_scheduler",{id:s})},startScheduledTask(s){return Ye("POST","/scheduler/start_scheduler",{id:s})},stopScheduledTask(s){return Ye("POST","/scheduler/stop_scheduler",{id:s})},runTaskNow(s){return Ye("POST","/scheduler/run_scheduler",{id:s})},getTaskLogs(s,e=50){return Ye("GET",`/scheduler/logs_scheduler?id=${s}&limit=${e}`)},ws:Cd,sessionWsSend(s,e,t){return Cd.send(e,t)},wsIsConnected(){return Cd.isConnected()},wsSubscribe(s,e){return Cd.subscribe(s,e)},getEmailConfigs(){return Ye("GET","/email/list_email")},getEmailConfig(s){return Ye("GET",`/email/detail_email?id=${s}`)},createEmailConfig(s){return Ye("POST","/email/create_email",s)},updateEmailConfig(s,e){return Ye("POST","/email/update_email",{id:s,...e})},deleteEmailConfig(s){return Ye("POST","/email/delete_email",{id:s})},setDefaultEmailConfig(s){return Ye("POST","/email/set_default_email",{id:s})},validateEmailConfig(s){return Ye("POST","/email/validate_email",{configId:s})},getDingtalkConfig(){return Ye("GET","/dingtalk/config_dingtalk")},updateDingtalkConfig(s){return Ye("POST","/dingtalk/config_dingtalk",s)},startDingtalk(){return Ye("POST","/dingtalk/start_dingtalk")},stopDingtalk(){return Ye("POST","/dingtalk/stop_dingtalk")},getGatewayStatus(){return Ye("GET","/dingtalk/status_dingtalk")},getQueueStatus(){return Ye("GET","/gateway/queue_gateway")},getWafConfig(){return Ye("GET","/gateway/waf_config_gateway")},updateWafConfig(s){return Ye("POST","/gateway/waf_update_gateway",s)},startWaf(){return Ye("POST","/gateway/waf_start_gateway")},stopWaf(){return Ye("POST","/gateway/waf_stop_gateway")},getWafStatus(){return Ye("GET","/gateway/waf_status_gateway")},getTerminalSessions(){return Ye("GET","/terminal/list_terminal")},createTerminalSession(){return Ye("POST","/terminal/create_terminal")},deleteTerminalSession(s){return Ye("POST","/terminal/delete_terminal",{id:s})},terminalWsConnect(s,e,t,i,n){if(Ep.has(s)){const l=Ep.get(s);if(l.readyState===WebSocket.OPEN)return l}const o=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal/${s}`,a=new WebSocket(o);return a.onopen=()=>{console.log(`Terminal WebSocket [${s}] connected`),t&&t()},a.onmessage=l=>{try{const d=JSON.parse(l.data);e&&e(d)}catch(d){console.error("Terminal WebSocket parse error:",d)}},a.onclose=()=>{console.log(`Terminal WebSocket [${s}] closed`),Ep.delete(s),i&&i()},a.onerror=l=>{console.error(`Terminal WebSocket [${s}] error:`,l),n&&n(l)},Ep.set(s,a),a},terminalWsDisconnect(s){const e=Ep.get(s);e&&(e.close(),Ep.delete(s))},terminalWsSend(s,e,t){const i=Ep.get(s);return i&&i.readyState===WebSocket.OPEN?(i.send(JSON.stringify({type:e,data:t})),!0):!1},terminalWsIsConnected(s){const e=Ep.get(s);return e&&e.readyState===WebSocket.OPEN},getWorkflowState(){return Ye("GET","/workflow/state_workflow")},updateWorkflowState(s,e,t){return Ye("POST","/workflow/update_workflow",{currentCategory:s,currentProject:e,currentStep:t})},gitIsRepo(){return Ye("GET","/git/is_repo_git")},gitStatus(){return Ye("GET","/git/status_git")},gitDiff(s,e){let t=`/git/diff_git?file=${encodeURIComponent(s)}`;return e&&(t+="&isNew=true"),Ye("GET",t)},gitRevert(s){return Ye("POST","/git/revert_git",{file:s})},gitRevertAll(){return Ye("POST","/git/revert_all_git")},gitDeleteFile(s){return Ye("POST","/git/delete_file_git",{file:s})},gitDiscardUntracked(){return Ye("POST","/git/discard_untracked_git")},getCustomActions(s){const e=s?`?type=${s}`:"";return Ye("GET",`/custom_action/list_custom_action${e}`)},createCustomAction(s){return Ye("POST","/custom_action/create_custom_action",s)},updateCustomAction(s,e){return Ye("POST","/custom_action/update_custom_action",{id:s,...e})},deleteCustomAction(s){return Ye("POST","/custom_action/delete_custom_action",{id:s})},getLocalSpecs(s){const e=s?`?projectPath=${encodeURIComponent(s)}`:"";return Ye("GET",`/spec/local_spec${e}`)},getSpecContent(s){return Ye("GET",`/spec/detail_spec?name=${encodeURIComponent(s)}`)},deleteLocalSpec(s){return Ye("POST","/spec/delete_spec",{name:s})},uploadSpec(s,e){return Ye("POST","/spec/upload_spec",{name:s,content:e})},getSpecRepositories(){return Ye("GET","/spec/repositories_spec")},createSpecRepository(s){return Ye("POST","/spec/create_repo_spec",s)},updateSpecRepository(s,e){return Ye("POST","/spec/update_repo_spec",{id:s,...e})},deleteSpecRepository(s){return Ye("POST","/spec/delete_repo_spec",{id:s})},getRepoSpecs(s){return Ye("GET",`/spec/repositories_spec?repoId=${s}`)},syncSpecRepository(s){return Ye("POST","/spec/sync_repo_spec",{repoId:s})},downloadSpec(s,e,t){return Ye("POST","/spec/download_repo_spec",{repoId:s,specName:e,projectPath:t})},downloadAll(s,e){return Ye("POST","/spec/download_repo_spec",{repoId:s,all:!0,projectPath:e})},downloadAllSpecs(s,e){return Ye("POST","/spec/download_repo_spec",{repoId:s,all:!0,projectPath:e})},getProjectPath(){return Ye("GET","/project/current_project")},getWikiMenu(){return Ye("GET","/wiki/menu_wiki")},getWikiContent(s){return Ye("GET",`/wiki/content_wiki?path=${encodeURIComponent(s)}`)},getWikiAsset(s){return`${Wv}/wiki/asset_wiki?path=${encodeURIComponent(s)}`},getMemory(s){const e=s?`?projectPath=${encodeURIComponent(s)}`:"";return Ye("GET",`/memory/get_memory${e}`)},saveMemory(s,e){return Ye("POST","/memory/save_memory",{projectPath:s,content:e})},getProjects(){return Ye("GET","/project/list_project")},getCurrentProject(){return Ye("GET","/project/current_project")},setCurrentProject(s){return Ye("POST","/project/set_current_project",{id:s})},createProject(s,e,t=""){return Ye("POST","/project/create_project",{name:s,path:e,description:t})},exportConfig(){return fetch(`${Wv}/sys_config/export_config`,{method:"GET"}).then(s=>{if(!s.ok)throw new Error("导出失败");return s.blob()})},importConfig(s){return Ye("POST","/sys_config/import_config",{content:s})},getSystemInfo(){return Ye("GET","/system/info_system")}},VAe={name:"FileSelectDialog",components:{FileSelectTreeNode:NAe},props:{visible:{type:Boolean,default:!1}},data(){return{loading:!1,currentPath:"",selectedPath:"",parentPath:null,fileTreeData:[]}},computed:{canGoUp(){return this.parentPath!==null&&this.parentPath!==""}},methods:{async loadFileTree(s=""){var e,t,i;this.loading=!0;try{const n=await Yt.browseFilesystem(s);this.currentPath=((e=n.data)==null?void 0:e.current_path)||s,this.parentPath=(t=n.data)==null?void 0:t.parent_path;const r=(((i=n.data)==null?void 0:i.items)||[]).map(o=>this.transformNode(o));r.sort((o,a)=>o.is_directory===a.is_directory?o.name.localeCompare(a.name):o.is_directory?-1:1),this.fileTreeData=r}catch(n){console.error("Load file tree failed:",n),this.fileTreeData=[]}finally{this.loading=!1}},transformNode(s){return{name:s.name,path:s.path,is_directory:s.is_directory,is_drive:s.is_drive||!1,size:s.size,has_children:s.is_directory,expanded:!1,children:[]}},handleSelect(s){this.selectedPath=s.path},handleConfirm(){this.selectedPath&&(this.$emit("select",this.selectedPath),this.$emit("update:visible",!1))},async handleLoadChildren({path:s,callback:e}){var t;try{const n=(((t=(await Yt.browseFilesystem(s)).data)==null?void 0:t.items)||[]).map(r=>this.transformNode(r));n.sort((r,o)=>r.is_directory===o.is_directory?r.name.localeCompare(o.name):r.is_directory?-1:1),e(n)}catch(i){console.error("Load children failed:",i),e([])}},goUp(){this.parentPath!==null&&this.loadFileTree(this.parentPath===""?"":this.parentPath)},goHome(){this.loadFileTree("")},refresh(){this.loadFileTree(this.currentPath||"")},handleClose(){this.$emit("close")},handleVisibleChange(s){this.$emit("update:visible",s)},open(){this.loadFileTree("")}},watch:{visible(s){s&&this.loadFileTree("")}}};var HAe=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{visible:e.visible,title:"选择文件",width:"500px","close-on-click-modal":!1},on:{"update:visible":e.handleVisibleChange,close:e.handleClose}},[t("div",{staticClass:"file-select-content"},[t("div",{staticClass:"file-tree-container"},[e._l(e.fileTreeData,function(i){return t("file-select-tree-node",{key:i.path,attrs:{node:i,level:0,"selected-path":e.selectedPath},on:{select:e.handleSelect,"load-children":e.handleLoadChildren}})}),e.loading?t("div",{staticClass:"empty-files"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.fileTreeData.length===0?t("div",{staticClass:"empty-files"},[e._v(" 此目录为空 ")]):e._e()],2),t("div",{staticClass:"file-select-footer"},[t("span",{staticClass:"selected-path"},[e._v(e._s(e.selectedPath||"未选择"))]),t("button",{staticClass:"confirm-btn",attrs:{disabled:!e.selectedPath},on:{click:e.handleConfirm}},[e._v("选择")])])])])},$Ae=[],zAe=en(VAe,HAe,$Ae,!1,null,"16166705");const jAe=zAe.exports,UAe={name:"SkillSelectDialog",props:{visible:{type:Boolean,default:!1}},data(){return{loading:!1,skills:[],selectedSkill:"",searchText:""}},computed:{filteredSkills(){if(!this.searchText)return this.skills;const s=this.searchText.toLowerCase();return this.skills.filter(e=>e.name.toLowerCase().includes(s)||e.description&&e.description.toLowerCase().includes(s))}},watch:{visible(s){s&&(this.loadSkills(),this.selectedSkill="",this.searchText="")}},methods:{async loadSkills(){this.loading=!0;try{const s=await Yt.getSkills();this.skills=s.data||[]}catch(s){console.error("Load skills failed:",s),this.skills=[]}finally{this.loading=!1,this.$nextTick(()=>{const s=this.$refs.searchInput;s&&s.focus()})}},handleConfirm(){this.selectedSkill&&(this.$emit("select",this.selectedSkill),this.$emit("update:visible",!1))},handleClose(){this.$emit("close")},handleVisibleChange(s){this.$emit("update:visible",s)}}};var qAe=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{visible:e.visible,title:"选择 Skill",width:"420px","close-on-click-modal":!1},on:{"update:visible":e.handleVisibleChange,close:e.handleClose}},[t("div",{staticClass:"skill-select-content"},[t("div",{staticClass:"skill-search"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],ref:"searchInput",staticClass:"search-input",attrs:{placeholder:"搜索 Skill..."},domProps:{value:e.searchText},on:{input:function(i){i.target.composing||(e.searchText=i.target.value)}}})]),t("div",{staticClass:"skill-list-container"},[e.loading?t("div",{staticClass:"empty-state"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.filteredSkills.length===0?t("div",{staticClass:"empty-state"},[e._v(" "+e._s(e.searchText?"无匹配 Skill":"无可用 Skill")+" ")]):e._e(),e._l(e.filteredSkills,function(i){return t("div",{key:i.name,staticClass:"skill-item",class:{"skill-selected":e.selectedSkill===i.name},on:{click:function(n){e.selectedSkill=i.name},dblclick:e.handleConfirm}},[t("div",{staticClass:"skill-name"},[e._v(e._s(i.name))]),i.description?t("div",{staticClass:"skill-desc"},[e._v(e._s(i.description))]):e._e()])})],2),t("div",{staticClass:"skill-select-footer"},[t("span",{staticClass:"selected-skill"},[e._v(e._s(e.selectedSkill||"未选择"))]),t("button",{staticClass:"confirm-btn",attrs:{disabled:!e.selectedSkill},on:{click:e.handleConfirm}},[e._v("选择")])])])])},KAe=[],GAe=en(UAe,qAe,KAe,!1,null,"26797d57");const YAe=GAe.exports,ZAe={name:"ModelSelectDialog",props:{visible:{type:Boolean,default:!1},currentModel:{type:String,default:""}},data(){return{models:[],loading:!1}},computed:{selectedModelName(){return this.currentModel}},watch:{visible(s){s&&this.loadModels()}},methods:{open(){this.loadModels()},async loadModels(){this.loading=!0;try{const s=await Yt.getModels();this.models=s.data||[]}catch(s){console.error("加载模型列表失败:",s),this.models=[]}finally{this.loading=!1}},handleSelect(s){this.$emit("select",s),this.$emit("update:visible",!1)},handleClose(){this.$emit("close")},handleVisibleChange(s){this.$emit("update:visible",s)}}};var XAe=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{visible:e.visible,title:"选择模型",width:"400px"},on:{"update:visible":e.handleVisibleChange,close:e.handleClose}},[t("div",{staticClass:"model-list"},[e._l(e.models,function(i){return t("div",{key:i.id,staticClass:"model-item",class:{active:e.selectedModelName===i.name},on:{click:function(n){return e.handleSelect(i)}}},[t("span",{staticClass:"model-name"},[e._v(e._s(i.name))]),t("span",{staticClass:"model-provider"},[e._v(e._s(i.providerId))])])}),e.loading?t("div",{staticClass:"empty-models"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.models.length===0?t("div",{staticClass:"empty-models"},[e._v(" 暂无可用模型 ")]):e._e()],2)])},QAe=[],JAe=en(ZAe,XAe,QAe,!1,null,"6d3bfd5e");const e2e=JAe.exports,t2e={name:"CommandDialog",props:{visible:{type:Boolean,default:!1}},data(){return{loading:!1,selectedCommand:"",commands:[{name:"/compact",description:"压缩当前会话上下文"}]}},methods:{open(){},handleExecute(s){this.$emit("execute",s.name),this.$emit("update:visible",!1)},handleClose(){this.$emit("close")},handleVisibleChange(s){this.$emit("update:visible",s)}}};var i2e=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{visible:e.visible,title:"命令",width:"500px","close-on-click-modal":!1},on:{"update:visible":e.handleVisibleChange,close:e.handleClose}},[t("div",{staticClass:"command-list"},[e._l(e.commands,function(i){return t("div",{key:i.name,staticClass:"command-item",class:{selected:e.selectedCommand===i.name},attrs:{title:"双击执行: "+i.name},on:{click:function(n){e.selectedCommand=i.name},dblclick:function(n){return e.handleExecute(i)}}},[t("span",{staticClass:"command-name"},[e._v(e._s(i.name))]),t("span",{staticClass:"command-desc"},[e._v(e._s(i.description))])])}),e.loading?t("div",{staticClass:"empty-commands"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e._e()],2)])},n2e=[],s2e=en(t2e,i2e,n2e,!1,null,"0e004acb");const r2e=s2e.exports,o2e={name:"ResizableTextarea",props:{value:{type:String,default:""},rows:{type:Number,default:5},minRows:{type:Number,default:2},maxRows:{type:Number,default:20}},data(){return{internalValue:this.value,currentRows:this.rows,isResizing:!1,isHovering:!1,startY:0,startRows:0}},computed:{showHandle(){return!0}},watch:{value(s){this.internalValue=s},internalValue(s){this.$emit("input",s)}},mounted(){document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.stopResize),this.$nextTick(()=>{var e;const s=(e=this.$el)==null?void 0:e.querySelector("textarea");s&&s.addEventListener("paste",this.handlePaste)})},beforeDestroy(){var e;document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.stopResize);const s=(e=this.$el)==null?void 0:e.querySelector("textarea");s&&s.removeEventListener("paste",this.handlePaste)},methods:{handleMouseEnter(){this.isHovering=!0},handleMouseLeave(){this.isResizing||(this.isHovering=!1)},startResize(s){this.isResizing=!0,this.isHovering=!1,this.startY=s.clientY,this.startRows=this.currentRows,document.body.style.cursor="ns-resize",document.body.style.userSelect="none"},handleMouseMove(s){if(!this.isResizing)return;const e=this.startY-s.clientY,i=Math.round(this.startRows+e/20);this.currentRows=Math.max(this.minRows,Math.min(this.maxRows,i))},stopResize(){this.isResizing&&(this.isResizing=!1,document.body.style.cursor="",document.body.style.userSelect="")},handlePaste(s){var i;const e=(i=s.clipboardData)==null?void 0:i.items;if(!e)return;const t=[];for(const n of e)n.type.startsWith("image/")&&t.push(n.getAsFile());t.length>0&&(s.preventDefault(),this.$emit("paste-image",t))}}};var a2e=function(){var e=this,t=e._self._c;return t("div",{staticClass:"resizable-textarea-outer",class:{"resize-hand-active":e.isResizing}},[e.showHandle?t("div",{staticClass:"resize-hand",on:{mousedown:e.startResize,mouseenter:e.handleMouseEnter,mouseleave:e.handleMouseLeave}}):e._e(),t("el-input",e._b({attrs:{type:"textarea",rows:e.currentRows},model:{value:e.internalValue,callback:function(i){e.internalValue=i},expression:"internalValue"}},"el-input",e.$attrs,!1)),e.showHandle&&e.isHovering?t("div",{staticClass:"resize-indicator"}):e._e()],1)},l2e=[],c2e=en(o2e,a2e,l2e,!1,null,"6841b5d4");const d2e=c2e.exports,u2e={name:"ImagePreviewList",props:{files:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}}};var h2e=function(){var e=this,t=e._self._c;return t("div",{staticClass:"image-preview-list"},e._l(e.files,function(i){return t("div",{key:i.id,staticClass:"image-preview-item"},[t("img",{staticClass:"thumbnail",attrs:{src:i.dataUrl}}),i.uploading?t("div",{staticClass:"upload-loading"},[t("span",{staticClass:"loading-spinner"})]):t("button",{staticClass:"remove-btn",attrs:{disabled:e.disabled},on:{click:function(n){return e.$emit("remove",i.id)}}},[e._v("×")])])}),0)},f2e=[],g2e=en(u2e,h2e,f2e,!1,null,"eab57595");const p2e=g2e.exports,m2e="/api";async function Ty(s,e,t=null){const i={method:s,headers:{"Content-Type":"application/json"}};t&&s!=="GET"&&(i.body=JSON.stringify(t));const r=await(await fetch(`${m2e}${e}`,i)).json();if(r.success===!1)throw new Error(r.error||r.message||"请求失败");return r}async function ive(s=20,e=0){return Ty("GET",`/session/list_session?limit=${s}&offset=${e}`)}async function nve(s="新会话",e=null){return Ty("POST","/session/create_session",{title:s,projectPath:e})}async function _2e(s,e){return Ty("POST","/session/update_session",{id:s,...e})}async function v2e(s){return Ty("POST","/session/delete_session",{id:s})}async function sve(s){return Ty("GET",`/chat/history_chat?sessionId=${s}`)}async function b2e(s){return Ty("GET",`/sys_config/get_config?key=${encodeURIComponent(s)}`)}async function C2e(s,e){return Ty("POST","/sys_config/set_config",{key:s,value:e})}const y2e="/api";async function w2e(s){const e=new FormData;e.append("file",s);const i=await(await fetch(`${y2e}/chat/upload_image_chat`,{method:"POST",body:e})).json();if(i.success===!1)throw new Error(i.error||"上传失败");return i}function S2e(s){var n;const e=s.input.trim(),t=s.chatMode==="plan"?`【计划模式】禁止修改任何代码,仅对用户输入进行分析并输出分析结果。
|
|
142
|
+
*/function Cu(s,e){for(var t in e)s[t]=e[t];return s}var yOe=/[!'()*]/g,wOe=function(s){return"%"+s.charCodeAt(0).toString(16)},SOe=/%2C/g,b1=function(s){return encodeURIComponent(s).replace(yOe,wOe).replace(SOe,",")};function bU(s){try{return decodeURIComponent(s)}catch{}return s}function xOe(s,e,t){e===void 0&&(e={});var i=t||kOe,n;try{n=i(s||"")}catch{n={}}for(var r in e){var o=e[r];n[r]=Array.isArray(o)?o.map(Ole):Ole(o)}return n}var Ole=function(s){return s==null||typeof s=="object"?s:String(s)};function kOe(s){var e={};return s=s.trim().replace(/^(\?|#|&)/,""),s&&s.split("&").forEach(function(t){var i=t.replace(/\+/g," ").split("="),n=bU(i.shift()),r=i.length>0?bU(i.join("=")):null;e[n]===void 0?e[n]=r:Array.isArray(e[n])?e[n].push(r):e[n]=[e[n],r]}),e}function LOe(s){var e=s?Object.keys(s).map(function(t){var i=s[t];if(i===void 0)return"";if(i===null)return b1(t);if(Array.isArray(i)){var n=[];return i.forEach(function(r){r!==void 0&&(r===null?n.push(b1(t)):n.push(b1(t)+"="+b1(r)))}),n.join("&")}return b1(t)+"="+b1(i)}).filter(function(t){return t.length>0}).join("&"):null;return e?"?"+e:""}var XF=/\/?$/;function QF(s,e,t,i){var n=i&&i.options.stringifyQuery,r=e.query||{};try{r=CU(r)}catch{}var o={name:e.name||s&&s.name,meta:s&&s.meta||{},path:e.path||"/",hash:e.hash||"",query:r,params:e.params||{},fullPath:Ale(e,n),matched:s?DOe(s):[]};return t&&(o.redirectedFrom=Ale(t,n)),Object.freeze(o)}function CU(s){if(Array.isArray(s))return s.map(CU);if(s&&typeof s=="object"){var e={};for(var t in s)e[t]=CU(s[t]);return e}else return s}var x_=QF(null,{path:"/"});function DOe(s){for(var e=[];s;)e.unshift(s),s=s.parent;return e}function Ale(s,e){var t=s.path,i=s.query;i===void 0&&(i={});var n=s.hash;n===void 0&&(n="");var r=e||LOe;return(t||"/")+r(i)+n}function O_e(s,e,t){return e===x_?s===e:e?s.path&&e.path?s.path.replace(XF,"")===e.path.replace(XF,"")&&(t||s.hash===e.hash&&$2(s.query,e.query)):s.name&&e.name?s.name===e.name&&(t||s.hash===e.hash&&$2(s.query,e.query)&&$2(s.params,e.params)):!1:!1}function $2(s,e){if(s===void 0&&(s={}),e===void 0&&(e={}),!s||!e)return s===e;var t=Object.keys(s).sort(),i=Object.keys(e).sort();return t.length!==i.length?!1:t.every(function(n,r){var o=s[n],a=i[r];if(a!==n)return!1;var l=e[n];return o==null||l==null?o===l:typeof o=="object"&&typeof l=="object"?$2(o,l):String(o)===String(l)})}function IOe(s,e){return s.path.replace(XF,"/").indexOf(e.path.replace(XF,"/"))===0&&(!e.hash||s.hash===e.hash)&&EOe(s.query,e.query)}function EOe(s,e){for(var t in e)if(!(t in s))return!1;return!0}function A_e(s){for(var e=0;e<s.matched.length;e++){var t=s.matched[e];for(var i in t.instances){var n=t.instances[i],r=t.enteredCbs[i];if(!(!n||!r)){delete t.enteredCbs[i];for(var o=0;o<r.length;o++)n._isBeingDestroyed||r[o](n)}}}}var TOe={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render:function(e,t){var i=t.props,n=t.children,r=t.parent,o=t.data;o.routerView=!0;for(var a=r.$createElement,l=i.name,d=r.$route,h=r._routerViewCache||(r._routerViewCache={}),f=0,p=!1;r&&r._routerRoot!==r;){var m=r.$vnode?r.$vnode.data:{};m.routerView&&f++,m.keepAlive&&r._directInactive&&r._inactive&&(p=!0),r=r.$parent}if(o.routerViewDepth=f,p){var v=h[l],b=v&&v.component;return b?(v.configProps&&Fle(b,o,v.route,v.configProps),a(b,o,n)):a()}var y=d.matched[f],x=y&&y.components[l];if(!y||!x)return h[l]=null,a();h[l]={component:x},o.registerRouteInstance=function(S,I){var E=y.instances[l];(I&&E!==S||!I&&E===S)&&(y.instances[l]=I)},(o.hook||(o.hook={})).prepatch=function(S,I){y.instances[l]=I.componentInstance},o.hook.init=function(S){S.data.keepAlive&&S.componentInstance&&S.componentInstance!==y.instances[l]&&(y.instances[l]=S.componentInstance),A_e(d)};var D=y.props&&y.props[l];return D&&(Cu(h[l],{route:d,configProps:D}),Fle(x,o,d,D)),a(x,o,n)}};function Fle(s,e,t,i){var n=e.props=NOe(t,i);if(n){n=e.props=Cu({},n);var r=e.attrs=e.attrs||{};for(var o in n)(!s.props||!(o in s.props))&&(r[o]=n[o],delete n[o])}}function NOe(s,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(s);case"boolean":return e?s.params:void 0}}function F_e(s,e,t){var i=s.charAt(0);if(i==="/")return s;if(i==="?"||i==="#")return e+s;var n=e.split("/");(!t||!n[n.length-1])&&n.pop();for(var r=s.replace(/^\//,"").split("/"),o=0;o<r.length;o++){var a=r[o];a===".."?n.pop():a!=="."&&n.push(a)}return n[0]!==""&&n.unshift(""),n.join("/")}function MOe(s){var e="",t="",i=s.indexOf("#");i>=0&&(e=s.slice(i),s=s.slice(0,i));var n=s.indexOf("?");return n>=0&&(t=s.slice(n+1),s=s.slice(0,n)),{path:s,query:t,hash:e}}function wm(s){return s.replace(/\/(?:\s*\/)+/g,"/")}var JF=Array.isArray||function(s){return Object.prototype.toString.call(s)=="[object Array]"},xx=V_e,ROe=XJ,POe=BOe,OOe=B_e,AOe=W_e,FOe=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function XJ(s,e){for(var t=[],i=0,n=0,r="",o=e&&e.delimiter||"/",a;(a=FOe.exec(s))!=null;){var l=a[0],d=a[1],h=a.index;if(r+=s.slice(n,h),n=h+l.length,d){r+=d[1];continue}var f=s[n],p=a[2],m=a[3],v=a[4],b=a[5],y=a[6],x=a[7];r&&(t.push(r),r="");var D=p!=null&&f!=null&&f!==p,S=y==="+"||y==="*",I=y==="?"||y==="*",E=a[2]||o,R=v||b;t.push({name:m||i++,prefix:p||"",delimiter:E,optional:I,repeat:S,partial:D,asterisk:!!x,pattern:R?HOe(R):x?".*":"[^"+z2(E)+"]+?"})}return n<s.length&&(r+=s.substr(n)),r&&t.push(r),t}function BOe(s,e){return B_e(XJ(s,e),e)}function WOe(s){return encodeURI(s).replace(/[\/?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function VOe(s){return encodeURI(s).replace(/[?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function B_e(s,e){for(var t=new Array(s.length),i=0;i<s.length;i++)typeof s[i]=="object"&&(t[i]=new RegExp("^(?:"+s[i].pattern+")$",JJ(e)));return function(n,r){for(var o="",a=n||{},l=r||{},d=l.pretty?WOe:encodeURIComponent,h=0;h<s.length;h++){var f=s[h];if(typeof f=="string"){o+=f;continue}var p=a[f.name],m;if(p==null)if(f.optional){f.partial&&(o+=f.prefix);continue}else throw new TypeError('Expected "'+f.name+'" to be defined');if(JF(p)){if(!f.repeat)throw new TypeError('Expected "'+f.name+'" to not repeat, but received `'+JSON.stringify(p)+"`");if(p.length===0){if(f.optional)continue;throw new TypeError('Expected "'+f.name+'" to not be empty')}for(var v=0;v<p.length;v++){if(m=d(p[v]),!t[h].test(m))throw new TypeError('Expected all "'+f.name+'" to match "'+f.pattern+'", but received `'+JSON.stringify(m)+"`");o+=(v===0?f.prefix:f.delimiter)+m}continue}if(m=f.asterisk?VOe(p):d(p),!t[h].test(m))throw new TypeError('Expected "'+f.name+'" to match "'+f.pattern+'", but received "'+m+'"');o+=f.prefix+m}return o}}function z2(s){return s.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function HOe(s){return s.replace(/([=!:$\/()])/g,"\\$1")}function QJ(s,e){return s.keys=e,s}function JJ(s){return s&&s.sensitive?"":"i"}function $Oe(s,e){var t=s.source.match(/\((?!\?)/g);if(t)for(var i=0;i<t.length;i++)e.push({name:i,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return QJ(s,e)}function zOe(s,e,t){for(var i=[],n=0;n<s.length;n++)i.push(V_e(s[n],e,t).source);var r=new RegExp("(?:"+i.join("|")+")",JJ(t));return QJ(r,e)}function jOe(s,e,t){return W_e(XJ(s,t),e,t)}function W_e(s,e,t){JF(e)||(t=e||t,e=[]),t=t||{};for(var i=t.strict,n=t.end!==!1,r="",o=0;o<s.length;o++){var a=s[o];if(typeof a=="string")r+=z2(a);else{var l=z2(a.prefix),d="(?:"+a.pattern+")";e.push(a),a.repeat&&(d+="(?:"+l+d+")*"),a.optional?a.partial?d=l+"("+d+")?":d="(?:"+l+"("+d+"))?":d=l+"("+d+")",r+=d}}var h=z2(t.delimiter||"/"),f=r.slice(-h.length)===h;return i||(r=(f?r.slice(0,-h.length):r)+"(?:"+h+"(?=$))?"),n?r+="$":r+=i&&f?"":"(?="+h+"|$)",QJ(new RegExp("^"+r,JJ(t)),e)}function V_e(s,e,t){return JF(e)||(t=e||t,e=[]),t=t||{},s instanceof RegExp?$Oe(s,e):JF(s)?zOe(s,e,t):jOe(s,e,t)}xx.parse=ROe;xx.compile=POe;xx.tokensToFunction=OOe;xx.tokensToRegExp=AOe;var Ble=Object.create(null);function j2(s,e,t){e=e||{};try{var i=Ble[s]||(Ble[s]=xx.compile(s));return typeof e.pathMatch=="string"&&(e[0]=e.pathMatch),i(e,{pretty:!0})}catch{return""}finally{delete e[0]}}function eee(s,e,t,i){var n=typeof s=="string"?{path:s}:s;if(n._normalized)return n;if(n.name){n=Cu({},s);var r=n.params;return r&&typeof r=="object"&&(n.params=Cu({},r)),n}if(!n.path&&n.params&&e){n=Cu({},n),n._normalized=!0;var o=Cu(Cu({},e.params),n.params);if(e.name)n.name=e.name,n.params=o;else if(e.matched.length){var a=e.matched[e.matched.length-1].path;n.path=j2(a,o,"path "+e.path)}return n}var l=MOe(n.path||""),d=e&&e.path||"/",h=l.path?F_e(l.path,d,t||n.append):d,f=xOe(l.query,n.query,i&&i.options.parseQuery),p=n.hash||l.hash;return p&&p.charAt(0)!=="#"&&(p="#"+p),{_normalized:!0,path:h,query:f,hash:p}}var UOe=[String,Object],qOe=[String,Array],Wle=function(){},KOe={name:"RouterLink",props:{to:{type:UOe,required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:qOe,default:"click"}},render:function(e){var t=this,i=this.$router,n=this.$route,r=i.resolve(this.to,n,this.append),o=r.location,a=r.route,l=r.href,d={},h=i.options.linkActiveClass,f=i.options.linkExactActiveClass,p=h??"router-link-active",m=f??"router-link-exact-active",v=this.activeClass==null?p:this.activeClass,b=this.exactActiveClass==null?m:this.exactActiveClass,y=a.redirectedFrom?QF(null,eee(a.redirectedFrom),null,i):a;d[b]=O_e(n,y,this.exactPath),d[v]=this.exact||this.exactPath?d[b]:IOe(n,y);var x=d[b]?this.ariaCurrentValue:null,D=function(z){Vle(z)&&(t.replace?i.replace(o,Wle):i.push(o,Wle))},S={click:Vle};Array.isArray(this.event)?this.event.forEach(function(z){S[z]=D}):S[this.event]=D;var I={class:d},E=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:l,route:a,navigate:D,isActive:d[v],isExactActive:d[b]});if(E){if(E.length===1)return E[0];if(E.length>1||!E.length)return E.length===0?e():e("span",{},E)}if(this.tag==="a")I.on=S,I.attrs={href:l,"aria-current":x};else{var R=H_e(this.$slots.default);if(R){R.isStatic=!1;var M=R.data=Cu({},R.data);M.on=M.on||{};for(var O in M.on){var V=M.on[O];O in S&&(M.on[O]=Array.isArray(V)?V:[V])}for(var te in S)te in M.on?M.on[te].push(S[te]):M.on[te]=D;var J=R.data.attrs=Cu({},R.data.attrs);J.href=l,J["aria-current"]=x}else I.on=S}return e(this.tag,I,this.$slots.default)}};function Vle(s){if(!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)&&!s.defaultPrevented&&!(s.button!==void 0&&s.button!==0)){if(s.currentTarget&&s.currentTarget.getAttribute){var e=s.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return s.preventDefault&&s.preventDefault(),!0}}function H_e(s){if(s){for(var e,t=0;t<s.length;t++)if(e=s[t],e.tag==="a"||e.children&&(e=H_e(e.children)))return e}}var e4;function yU(s){if(!(yU.installed&&e4===s)){yU.installed=!0,e4=s;var e=function(n){return n!==void 0},t=function(n,r){var o=n.$options._parentVnode;e(o)&&e(o=o.data)&&e(o=o.registerRouteInstance)&&o(n,r)};s.mixin({beforeCreate:function(){e(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),s.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,t(this,this)},destroyed:function(){t(this)}}),Object.defineProperty(s.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(s.prototype,"$route",{get:function(){return this._routerRoot._route}}),s.component("RouterView",TOe),s.component("RouterLink",KOe);var i=s.config.optionMergeStrategies;i.beforeRouteEnter=i.beforeRouteLeave=i.beforeRouteUpdate=i.created}}var cN=typeof window<"u";function vA(s,e,t,i,n){var r=e||[],o=t||Object.create(null),a=i||Object.create(null);s.forEach(function(h){wU(r,o,a,h,n)});for(var l=0,d=r.length;l<d;l++)r[l]==="*"&&(r.push(r.splice(l,1)[0]),d--,l--);return{pathList:r,pathMap:o,nameMap:a}}function wU(s,e,t,i,n,r){var o=i.path,a=i.name,l=i.pathToRegexpOptions||{},d=YOe(o,n,l.strict);typeof i.caseSensitive=="boolean"&&(l.sensitive=i.caseSensitive);var h={path:d,regex:GOe(d,l),components:i.components||{default:i.component},alias:i.alias?typeof i.alias=="string"?[i.alias]:i.alias:[],instances:{},enteredCbs:{},name:a,parent:n,matchAs:r,redirect:i.redirect,beforeEnter:i.beforeEnter,meta:i.meta||{},props:i.props==null?{}:i.components?i.props:{default:i.props}};if(i.children&&i.children.forEach(function(b){var y=r?wm(r+"/"+b.path):void 0;wU(s,e,t,b,h,y)}),e[h.path]||(s.push(h.path),e[h.path]=h),i.alias!==void 0)for(var f=Array.isArray(i.alias)?i.alias:[i.alias],p=0;p<f.length;++p){var m=f[p],v={path:m,children:i.children};wU(s,e,t,v,n,h.path||"/")}a&&(t[a]||(t[a]=h))}function GOe(s,e){var t=xx(s,[],e);return t}function YOe(s,e,t){return t||(s=s.replace(/\/$/,"")),s[0]==="/"||e==null?s:wm(e.path+"/"+s)}function ZOe(s,e){var t=vA(s),i=t.pathList,n=t.pathMap,r=t.nameMap;function o(m){vA(m,i,n,r)}function a(m,v){var b=typeof m!="object"?r[m]:void 0;vA([v||m],i,n,r,b),b&&b.alias.length&&vA(b.alias.map(function(y){return{path:y,children:[v]}}),i,n,r,b)}function l(){return i.map(function(m){return n[m]})}function d(m,v,b){var y=eee(m,v,!1,e),x=y.name;if(x){var D=r[x];if(!D)return p(null,y);var S=D.regex.keys.filter(function(O){return!O.optional}).map(function(O){return O.name});if(typeof y.params!="object"&&(y.params={}),v&&typeof v.params=="object")for(var I in v.params)!(I in y.params)&&S.indexOf(I)>-1&&(y.params[I]=v.params[I]);return y.path=j2(D.path,y.params),p(D,y,b)}else if(y.path){y.params={};for(var E=0;E<i.length;E++){var R=i[E],M=n[R];if(XOe(M.regex,y.path,y.params))return p(M,y,b)}}return p(null,y)}function h(m,v){var b=m.redirect,y=typeof b=="function"?b(QF(m,v,null,e)):b;if(typeof y=="string"&&(y={path:y}),!y||typeof y!="object")return p(null,v);var x=y,D=x.name,S=x.path,I=v.query,E=v.hash,R=v.params;if(I=x.hasOwnProperty("query")?x.query:I,E=x.hasOwnProperty("hash")?x.hash:E,R=x.hasOwnProperty("params")?x.params:R,D)return r[D],d({_normalized:!0,name:D,query:I,hash:E,params:R},void 0,v);if(S){var M=QOe(S,m),O=j2(M,R);return d({_normalized:!0,path:O,query:I,hash:E},void 0,v)}else return p(null,v)}function f(m,v,b){var y=j2(b,v.params),x=d({_normalized:!0,path:y});if(x){var D=x.matched,S=D[D.length-1];return v.params=x.params,p(S,v)}return p(null,v)}function p(m,v,b){return m&&m.redirect?h(m,b||v):m&&m.matchAs?f(m,v,m.matchAs):QF(m,v,b,e)}return{match:d,addRoute:a,getRoutes:l,addRoutes:o}}function XOe(s,e,t){var i=e.match(s);if(i){if(!t)return!0}else return!1;for(var n=1,r=i.length;n<r;++n){var o=s.keys[n-1];o&&(t[o.name||"pathMatch"]=typeof i[n]=="string"?bU(i[n]):i[n])}return!0}function QOe(s,e){return F_e(s,e.parent?e.parent.path:"/",!0)}var JOe=cN&&window.performance&&window.performance.now?window.performance:Date;function $_e(){return JOe.now().toFixed(3)}var z_e=$_e();function uV(){return z_e}function j_e(s){return z_e=s}var U_e=Object.create(null);function q_e(){"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual");var s=window.location.protocol+"//"+window.location.host,e=window.location.href.replace(s,""),t=Cu({},window.history.state);return t.key=uV(),window.history.replaceState(t,"",e),window.addEventListener("popstate",Hle),function(){window.removeEventListener("popstate",Hle)}}function Sm(s,e,t,i){if(s.app){var n=s.options.scrollBehavior;n&&s.app.$nextTick(function(){var r=eAe(),o=n.call(s,e,t,i?r:null);o&&(typeof o.then=="function"?o.then(function(a){jle(a,r)}).catch(function(a){}):jle(o,r))})}}function K_e(){var s=uV();s&&(U_e[s]={x:window.pageXOffset,y:window.pageYOffset})}function Hle(s){K_e(),s.state&&s.state.key&&j_e(s.state.key)}function eAe(){var s=uV();if(s)return U_e[s]}function tAe(s,e){var t=document.documentElement,i=t.getBoundingClientRect(),n=s.getBoundingClientRect();return{x:n.left-i.left-e.x,y:n.top-i.top-e.y}}function $le(s){return IS(s.x)||IS(s.y)}function zle(s){return{x:IS(s.x)?s.x:window.pageXOffset,y:IS(s.y)?s.y:window.pageYOffset}}function iAe(s){return{x:IS(s.x)?s.x:0,y:IS(s.y)?s.y:0}}function IS(s){return typeof s=="number"}var nAe=/^#\d/;function jle(s,e){var t=typeof s=="object";if(t&&typeof s.selector=="string"){var i=nAe.test(s.selector)?document.getElementById(s.selector.slice(1)):document.querySelector(s.selector);if(i){var n=s.offset&&typeof s.offset=="object"?s.offset:{};n=iAe(n),e=tAe(i,n)}else $le(s)&&(e=zle(s))}else t&&$le(s)&&(e=zle(s));e&&("scrollBehavior"in document.documentElement.style?window.scrollTo({left:e.x,top:e.y,behavior:s.behavior}):window.scrollTo(e.x,e.y))}var xm=cN&&function(){var s=window.navigator.userAgent;return(s.indexOf("Android 2.")!==-1||s.indexOf("Android 4.0")!==-1)&&s.indexOf("Mobile Safari")!==-1&&s.indexOf("Chrome")===-1&&s.indexOf("Windows Phone")===-1?!1:window.history&&typeof window.history.pushState=="function"}();function t4(s,e){K_e();var t=window.history;try{if(e){var i=Cu({},t.state);i.key=uV(),t.replaceState(i,"",s)}else t.pushState({key:j_e($_e())},"",s)}catch{window.location[e?"replace":"assign"](s)}}function SU(s){t4(s,!0)}var Ey={redirected:2,aborted:4,cancelled:8,duplicated:16};function sAe(s,e){return hV(s,e,Ey.redirected,'Redirected when going from "'+s.fullPath+'" to "'+lAe(e)+'" via a navigation guard.')}function rAe(s,e){var t=hV(s,e,Ey.duplicated,'Avoided redundant navigation to current location: "'+s.fullPath+'".');return t.name="NavigationDuplicated",t}function Ule(s,e){return hV(s,e,Ey.cancelled,'Navigation cancelled from "'+s.fullPath+'" to "'+e.fullPath+'" with a new navigation.')}function oAe(s,e){return hV(s,e,Ey.aborted,'Navigation aborted from "'+s.fullPath+'" to "'+e.fullPath+'" via a navigation guard.')}function hV(s,e,t,i){var n=new Error(i);return n._isRouter=!0,n.from=s,n.to=e,n.type=t,n}var aAe=["params","query","hash"];function lAe(s){if(typeof s=="string")return s;if("path"in s)return s.path;var e={};return aAe.forEach(function(t){t in s&&(e[t]=s[t])}),JSON.stringify(e,null,2)}function i4(s){return Object.prototype.toString.call(s).indexOf("Error")>-1}function fV(s,e){return i4(s)&&s._isRouter&&(e==null||s.type===e)}function qle(s,e,t){var i=function(n){n>=s.length?t():s[n]?e(s[n],function(){i(n+1)}):i(n+1)};i(0)}function cAe(s){return function(e,t,i){var n=!1,r=0,o=null;G_e(s,function(a,l,d,h){if(typeof a=="function"&&a.cid===void 0){n=!0,r++;var f=Kle(function(b){uAe(b)&&(b=b.default),a.resolved=typeof b=="function"?b:e4.extend(b),d.components[h]=b,r--,r<=0&&i()}),p=Kle(function(b){var y="Failed to resolve async component "+h+": "+b;o||(o=i4(b)?b:new Error(y),i(o))}),m;try{m=a(f,p)}catch(b){p(b)}if(m)if(typeof m.then=="function")m.then(f,p);else{var v=m.component;v&&typeof v.then=="function"&&v.then(f,p)}}}),n||i()}}function G_e(s,e){return Y_e(s.map(function(t){return Object.keys(t.components).map(function(i){return e(t.components[i],t.instances[i],t,i)})}))}function Y_e(s){return Array.prototype.concat.apply([],s)}var dAe=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function uAe(s){return s.__esModule||dAe&&s[Symbol.toStringTag]==="Module"}function Kle(s){var e=!1;return function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];if(!e)return e=!0,s.apply(this,t)}}var zu=function(e,t){this.router=e,this.base=hAe(t),this.current=x_,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};zu.prototype.listen=function(e){this.cb=e};zu.prototype.onReady=function(e,t){this.ready?e():(this.readyCbs.push(e),t&&this.readyErrorCbs.push(t))};zu.prototype.onError=function(e){this.errorCbs.push(e)};zu.prototype.transitionTo=function(e,t,i){var n=this,r;try{r=this.router.match(e,this.current)}catch(a){throw this.errorCbs.forEach(function(l){l(a)}),a}var o=this.current;this.confirmTransition(r,function(){n.updateRoute(r),t&&t(r),n.ensureURL(),n.router.afterHooks.forEach(function(a){a&&a(r,o)}),n.ready||(n.ready=!0,n.readyCbs.forEach(function(a){a(r)}))},function(a){i&&i(a),a&&!n.ready&&(!fV(a,Ey.redirected)||o!==x_)&&(n.ready=!0,n.readyErrorCbs.forEach(function(l){l(a)}))})};zu.prototype.confirmTransition=function(e,t,i){var n=this,r=this.current;this.pending=e;var o=function(b){!fV(b)&&i4(b)&&(n.errorCbs.length?n.errorCbs.forEach(function(y){y(b)}):console.error(b)),i&&i(b)},a=e.matched.length-1,l=r.matched.length-1;if(O_e(e,r)&&a===l&&e.matched[a]===r.matched[l])return this.ensureURL(),e.hash&&Sm(this.router,r,e,!1),o(rAe(r,e));var d=fAe(this.current.matched,e.matched),h=d.updated,f=d.deactivated,p=d.activated,m=[].concat(pAe(f),this.router.beforeHooks,mAe(h),p.map(function(b){return b.beforeEnter}),cAe(p)),v=function(b,y){if(n.pending!==e)return o(Ule(r,e));try{b(e,r,function(x){x===!1?(n.ensureURL(!0),o(oAe(r,e))):i4(x)?(n.ensureURL(!0),o(x)):typeof x=="string"||typeof x=="object"&&(typeof x.path=="string"||typeof x.name=="string")?(o(sAe(r,e)),typeof x=="object"&&x.replace?n.replace(x):n.push(x)):y(x)})}catch(x){o(x)}};qle(m,v,function(){var b=_Ae(p),y=b.concat(n.router.resolveHooks);qle(y,v,function(){if(n.pending!==e)return o(Ule(r,e));n.pending=null,t(e),n.router.app&&n.router.app.$nextTick(function(){A_e(e)})})})};zu.prototype.updateRoute=function(e){this.current=e,this.cb&&this.cb(e)};zu.prototype.setupListeners=function(){};zu.prototype.teardown=function(){this.listeners.forEach(function(e){e()}),this.listeners=[],this.current=x_,this.pending=null};function hAe(s){if(!s)if(cN){var e=document.querySelector("base");s=e&&e.getAttribute("href")||"/",s=s.replace(/^https?:\/\/[^\/]+/,"")}else s="/";return s.charAt(0)!=="/"&&(s="/"+s),s.replace(/\/$/,"")}function fAe(s,e){var t,i=Math.max(s.length,e.length);for(t=0;t<i&&s[t]===e[t];t++);return{updated:e.slice(0,t),activated:e.slice(t),deactivated:s.slice(t)}}function tee(s,e,t,i){var n=G_e(s,function(r,o,a,l){var d=gAe(r,e);if(d)return Array.isArray(d)?d.map(function(h){return t(h,o,a,l)}):t(d,o,a,l)});return Y_e(i?n.reverse():n)}function gAe(s,e){return typeof s!="function"&&(s=e4.extend(s)),s.options[e]}function pAe(s){return tee(s,"beforeRouteLeave",Z_e,!0)}function mAe(s){return tee(s,"beforeRouteUpdate",Z_e)}function Z_e(s,e){if(e)return function(){return s.apply(e,arguments)}}function _Ae(s){return tee(s,"beforeRouteEnter",function(e,t,i,n){return vAe(e,i,n)})}function vAe(s,e,t){return function(n,r,o){return s(n,r,function(a){typeof a=="function"&&(e.enteredCbs[t]||(e.enteredCbs[t]=[]),e.enteredCbs[t].push(a)),o(a)})}}var X_e=function(s){function e(t,i){s.call(this,t,i),this._startLocation=TD(this.base)}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var i=this;if(!(this.listeners.length>0)){var n=this.router,r=n.options.scrollBehavior,o=xm&&r;o&&this.listeners.push(q_e());var a=function(){var l=i.current,d=TD(i.base);i.current===x_&&d===i._startLocation||i.transitionTo(d,function(h){o&&Sm(n,h,l,!0)})};window.addEventListener("popstate",a),this.listeners.push(function(){window.removeEventListener("popstate",a)})}},e.prototype.go=function(i){window.history.go(i)},e.prototype.push=function(i,n,r){var o=this,a=this,l=a.current;this.transitionTo(i,function(d){t4(wm(o.base+d.fullPath)),Sm(o.router,d,l,!1),n&&n(d)},r)},e.prototype.replace=function(i,n,r){var o=this,a=this,l=a.current;this.transitionTo(i,function(d){SU(wm(o.base+d.fullPath)),Sm(o.router,d,l,!1),n&&n(d)},r)},e.prototype.ensureURL=function(i){if(TD(this.base)!==this.current.fullPath){var n=wm(this.base+this.current.fullPath);i?t4(n):SU(n)}},e.prototype.getCurrentLocation=function(){return TD(this.base)},e}(zu);function TD(s){var e=window.location.pathname,t=e.toLowerCase(),i=s.toLowerCase();return s&&(t===i||t.indexOf(wm(i+"/"))===0)&&(e=e.slice(s.length)),(e||"/")+window.location.search+window.location.hash}var Q_e=function(s){function e(t,i,n){s.call(this,t,i),!(n&&bAe(this.base))&&Gle()}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var i=this;if(!(this.listeners.length>0)){var n=this.router,r=n.options.scrollBehavior,o=xm&&r;o&&this.listeners.push(q_e());var a=function(){var d=i.current;Gle()&&i.transitionTo(U2(),function(h){o&&Sm(i.router,h,d,!0),xm||q2(h.fullPath)})},l=xm?"popstate":"hashchange";window.addEventListener(l,a),this.listeners.push(function(){window.removeEventListener(l,a)})}},e.prototype.push=function(i,n,r){var o=this,a=this,l=a.current;this.transitionTo(i,function(d){Yle(d.fullPath),Sm(o.router,d,l,!1),n&&n(d)},r)},e.prototype.replace=function(i,n,r){var o=this,a=this,l=a.current;this.transitionTo(i,function(d){q2(d.fullPath),Sm(o.router,d,l,!1),n&&n(d)},r)},e.prototype.go=function(i){window.history.go(i)},e.prototype.ensureURL=function(i){var n=this.current.fullPath;U2()!==n&&(i?Yle(n):q2(n))},e.prototype.getCurrentLocation=function(){return U2()},e}(zu);function bAe(s){var e=TD(s);if(!/^\/#/.test(e))return window.location.replace(wm(s+"/#"+e)),!0}function Gle(){var s=U2();return s.charAt(0)==="/"?!0:(q2("/"+s),!1)}function U2(){var s=window.location.href,e=s.indexOf("#");return e<0?"":(s=s.slice(e+1),s)}function xU(s){var e=window.location.href,t=e.indexOf("#"),i=t>=0?e.slice(0,t):e;return i+"#"+s}function Yle(s){xm?t4(xU(s)):window.location.hash=s}function q2(s){xm?SU(xU(s)):window.location.replace(xU(s))}var CAe=function(s){function e(t,i){s.call(this,t,i),this.stack=[],this.index=-1}return s&&(e.__proto__=s),e.prototype=Object.create(s&&s.prototype),e.prototype.constructor=e,e.prototype.push=function(i,n,r){var o=this;this.transitionTo(i,function(a){o.stack=o.stack.slice(0,o.index+1).concat(a),o.index++,n&&n(a)},r)},e.prototype.replace=function(i,n,r){var o=this;this.transitionTo(i,function(a){o.stack=o.stack.slice(0,o.index).concat(a),n&&n(a)},r)},e.prototype.go=function(i){var n=this,r=this.index+i;if(!(r<0||r>=this.stack.length)){var o=this.stack[r];this.confirmTransition(o,function(){var a=n.current;n.index=r,n.updateRoute(o),n.router.afterHooks.forEach(function(l){l&&l(o,a)})},function(a){fV(a,Ey.duplicated)&&(n.index=r)})}},e.prototype.getCurrentLocation=function(){var i=this.stack[this.stack.length-1];return i?i.fullPath:"/"},e.prototype.ensureURL=function(){},e}(zu),Ps=function(e){e===void 0&&(e={}),this.app=null,this.apps=[],this.options=e,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=ZOe(e.routes||[],this);var t=e.mode||"hash";switch(this.fallback=t==="history"&&!xm&&e.fallback!==!1,this.fallback&&(t="hash"),cN||(t="abstract"),this.mode=t,t){case"history":this.history=new X_e(this,e.base);break;case"hash":this.history=new Q_e(this,e.base,this.fallback);break;case"abstract":this.history=new CAe(this,e.base);break}},J_e={currentRoute:{configurable:!0}};Ps.prototype.match=function(e,t,i){return this.matcher.match(e,t,i)};J_e.currentRoute.get=function(){return this.history&&this.history.current};Ps.prototype.init=function(e){var t=this;if(this.apps.push(e),e.$once("hook:destroyed",function(){var o=t.apps.indexOf(e);o>-1&&t.apps.splice(o,1),t.app===e&&(t.app=t.apps[0]||null),t.app||t.history.teardown()}),!this.app){this.app=e;var i=this.history;if(i instanceof X_e||i instanceof Q_e){var n=function(o){var a=i.current,l=t.options.scrollBehavior,d=xm&&l;d&&"fullPath"in o&&Sm(t,o,a,!1)},r=function(o){i.setupListeners(),n(o)};i.transitionTo(i.getCurrentLocation(),r,r)}i.listen(function(o){t.apps.forEach(function(a){a._route=o})})}};Ps.prototype.beforeEach=function(e){return iee(this.beforeHooks,e)};Ps.prototype.beforeResolve=function(e){return iee(this.resolveHooks,e)};Ps.prototype.afterEach=function(e){return iee(this.afterHooks,e)};Ps.prototype.onReady=function(e,t){this.history.onReady(e,t)};Ps.prototype.onError=function(e){this.history.onError(e)};Ps.prototype.push=function(e,t,i){var n=this;if(!t&&!i&&typeof Promise<"u")return new Promise(function(r,o){n.history.push(e,r,o)});this.history.push(e,t,i)};Ps.prototype.replace=function(e,t,i){var n=this;if(!t&&!i&&typeof Promise<"u")return new Promise(function(r,o){n.history.replace(e,r,o)});this.history.replace(e,t,i)};Ps.prototype.go=function(e){this.history.go(e)};Ps.prototype.back=function(){this.go(-1)};Ps.prototype.forward=function(){this.go(1)};Ps.prototype.getMatchedComponents=function(e){var t=e?e.matched?e:this.resolve(e).route:this.currentRoute;return t?[].concat.apply([],t.matched.map(function(i){return Object.keys(i.components).map(function(n){return i.components[n]})})):[]};Ps.prototype.resolve=function(e,t,i){t=t||this.history.current;var n=eee(e,t,i,this),r=this.match(n,t),o=r.redirectedFrom||r.fullPath,a=this.history.base,l=yAe(a,o,this.mode);return{location:n,route:r,href:l,normalizedTo:n,resolved:r}};Ps.prototype.getRoutes=function(){return this.matcher.getRoutes()};Ps.prototype.addRoute=function(e,t){this.matcher.addRoute(e,t),this.history.current!==x_&&this.history.transitionTo(this.history.getCurrentLocation())};Ps.prototype.addRoutes=function(e){this.matcher.addRoutes(e),this.history.current!==x_&&this.history.transitionTo(this.history.getCurrentLocation())};Object.defineProperties(Ps.prototype,J_e);var eve=Ps;function iee(s,e){return s.push(e),function(){var t=s.indexOf(e);t>-1&&s.splice(t,1)}}function yAe(s,e,t){var i=t==="hash"?"#"+e:e;return s?wm(s+"/"+i):i}Ps.install=yU;Ps.version="3.6.5";Ps.isNavigationFailure=fV;Ps.NavigationFailureType=Ey;Ps.START_LOCATION=x_;cN&&window.Vue&&window.Vue.use(Ps);const wAe={name:"SessionsSidebar",props:{sessions:{type:Array,default:()=>[]},currentSessionId:{type:String,default:null},hasMore:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1}},methods:{formatTime(s){if(!s)return"";const e=new Date(s),t=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0"),n=String(e.getHours()).padStart(2,"0"),r=String(e.getMinutes()).padStart(2,"0");return`${t}-${i} ${n}:${r}`}}};var SAe=function(){var e=this,t=e._self._c;return t("aside",{staticClass:"sidebar"},[t("div",{staticClass:"sidebar-header"},[t("div",{staticClass:"sidebar-title"},[e._v("会话列表")]),t("el-button",{staticClass:"new-btn",attrs:{type:"primary",size:"small"},on:{click:function(i){return e.$emit("create")}}},[e._v(" + 新建 ")])],1),t("div",{staticClass:"sidebar-content"},[e._l(e.sessions,function(i){return t("div",{key:i.id,staticClass:"session-item",class:{active:e.currentSessionId===i.id},attrs:{draggable:"true"},on:{dragstart:function(n){return e.$emit("dragstart",n,i)},click:function(n){return e.$emit("select",i)}}},[t("div",{staticClass:"session-row"},[t("span",{staticClass:"session-title truncate"},[e._v(e._s(i.title||"新会话"))]),t("span",{staticClass:"session-time"},[e._v(e._s(e.formatTime(i.createdAt)))]),t("div",{staticClass:"session-actions",on:{click:function(n){n.stopPropagation()}}},[t("el-dropdown",{attrs:{trigger:"click"},on:{command:n=>e.$emit("command",n,i)}},[t("span",{staticClass:"action-btn"},[e._v("⋮")]),t("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t("el-dropdown-item",{attrs:{command:"rename"}},[e._v("重命名")]),t("el-dropdown-item",{attrs:{command:"delete",divided:""}},[e._v("删除")])],1)],1)],1)])])}),e.hasMore?t("div",{staticClass:"load-more",on:{click:function(i){return e.$emit("loadmore")}}},[t("el-button",{attrs:{size:"small",loading:e.loadingMore}},[e._v("加载更多")])],1):e._e()],2)])},xAe=[],kAe=en(wAe,SAe,xAe,!1,null,"acaadcd7");const LAe=kAe.exports,DAe={name:"FileSelectTreeNode",props:{node:{type:Object,required:!0},level:{type:Number,default:0},selectedPath:{type:String,default:""}},data(){return{expanded:!1,loading:!1,loadedChildren:this.node.children||[]}},computed:{isSelected(){return this.selectedPath===this.node.path}},watch:{node:{immediate:!0,handler(s){s.children&&s.children.length>0&&(this.loadedChildren=s.children)}}},methods:{async toggleExpand(){if(this.node.is_directory)if(!this.expanded&&this.loadedChildren.length===0&&this.node.has_children){this.loading=!0;try{this.$emit("load-children",{path:this.node.path,callback:s=>{this.loadedChildren=s,this.expanded=!0,this.loading=!1}})}catch(s){console.error("Failed to load children:",s),this.loading=!1}}else this.expanded=!this.expanded},handleClick(){this.$emit("select",this.node),this.node.is_directory&&this.toggleExpand()},handleDblClick(){},getFileIcon(s,e){if(e)return"fa-solid fa-folder text-yellow-500";const t=s.split(".").pop().toLowerCase(),i=s.toLowerCase(),n={js:"fa-brands fa-js text-yellow-400",jsx:"fa-brands fa-react text-blue-400",ts:"fa-brands fa-js text-blue-400",tsx:"fa-brands fa-react text-blue-400",html:"fa-brands fa-html5 text-orange-500",htm:"fa-brands fa-html5 text-orange-500",css:"fa-brands fa-css3 text-blue-400",scss:"fa-brands fa-sass text-pink-400",sass:"fa-brands fa-sass text-pink-400",vue:"fa-brands fa-vuejs text-green-400",py:"fa-brands fa-python text-blue-500",pyc:"fa-brands fa-python text-gray-400",json:"fa-solid fa-file-code text-yellow-300",yaml:"fa-solid fa-file-code text-blue-300",yml:"fa-solid fa-file-code text-blue-300",xml:"fa-solid fa-file-code text-orange-300",md:"fa-solid fa-file-lines text-gray-400",markdown:"fa-solid fa-file-lines text-gray-400",sql:"fa-solid fa-database text-gray-400",sh:"fa-solid fa-terminal text-green-400",bash:"fa-solid fa-terminal text-green-400",go:"fa-brands fa-golang text-cyan-400",rs:"fa-brands fa-rust text-orange-400",java:"fa-brands fa-java text-red-400",kt:"fa-brands fa-android text-purple-400",swift:"fa-brands fa-apple text-blue-300",c:"fa-solid fa-file-code text-blue-300",cpp:"fa-solid fa-file-code text-blue-400",cc:"fa-solid fa-file-code text-blue-400",h:"fa-solid fa-file-code text-blue-300",hpp:"fa-solid fa-file-code text-blue-400",cs:"fa-brands fa-microsoft text-purple-400",rb:"fa-solid fa-gem text-red-400",php:"fa-brands fa-php text-purple-400",dockerfile:"fa-brands fa-docker text-blue-400",gitignore:"fa-brands fa-git text-red-400",gitattributes:"fa-brands fa-git text-red-400",license:"fa-solid fa-scale-balanced text-yellow-400",png:"fa-solid fa-image text-green-400",jpg:"fa-solid fa-image text-green-400",jpeg:"fa-solid fa-image text-green-400",gif:"fa-solid fa-image text-green-400",svg:"fa-solid fa-image text-green-400",ico:"fa-solid fa-image text-green-400",webp:"fa-solid fa-image text-green-400",bmp:"fa-solid fa-image text-green-400",mp4:"fa-solid fa-film text-purple-400",avi:"fa-solid fa-film text-purple-400",mov:"fa-solid fa-film text-purple-400",mkv:"fa-solid fa-film text-purple-400",mp3:"fa-solid fa-music text-pink-400",wav:"fa-solid fa-music text-pink-400",flac:"fa-solid fa-music text-pink-400",woff:"fa-solid fa-font text-blue-400",woff2:"fa-solid fa-font text-blue-400",ttf:"fa-solid fa-font text-blue-400",otf:"fa-solid fa-font text-blue-400",eot:"fa-solid fa-font text-blue-400",zip:"fa-solid fa-file-zipper text-yellow-600",rar:"fa-solid fa-file-zipper text-yellow-600","7z":"fa-solid fa-file-zipper text-yellow-600",tar:"fa-solid fa-file-zipper text-yellow-600",gz:"fa-solid fa-file-zipper text-yellow-600",pdf:"fa-solid fa-file-pdf text-red-500",doc:"fa-solid fa-file-word text-blue-600",docx:"fa-solid fa-file-word text-blue-600",xls:"fa-solid fa-file-excel text-green-600",xlsx:"fa-solid fa-file-excel text-green-600",ppt:"fa-solid fa-file-powerpoint text-orange-600",pptx:"fa-solid fa-file-powerpoint text-orange-600"};return i==="dockerfile"?n.dockerfile:i===".gitignore"?n.gitignore:i===".gitattributes"?n.gitattributes:i==="license"||i.startsWith("license")?n.license:i.startsWith("readme")?n.md:n[t]||"fa-solid fa-file text-gray-400"}}};var IAe=function(){var i;var e=this,t=e._self._c;return t("div",{staticClass:"file-tree-node"},[t("div",{staticClass:"node-content",class:{selected:e.isSelected,directory:e.node.is_directory},style:{paddingLeft:e.level*16+4+"px"},on:{click:e.handleClick,dblclick:e.handleDblClick}},[e.node.is_directory?t("span",{staticClass:"expand-icon",on:{click:function(n){return n.stopPropagation(),e.toggleExpand.apply(null,arguments)}}},[e.loading?t("i",{staticClass:"fa-solid fa-spinner fa-spin"}):e.expanded?t("i",{staticClass:"fa-solid fa-chevron-down"}):e.node.has_children||e.node.children&&e.node.children.length>0?t("i",{staticClass:"fa-solid fa-chevron-right"}):t("span",{staticClass:"placeholder"})]):t("span",{staticClass:"expand-icon placeholder"}),t("span",{staticClass:"node-icon"},[t("i",{class:e.getFileIcon(e.node.name,e.node.is_directory)})]),t("span",{staticClass:"node-name"},[e._v(e._s(e.node.name))])]),e.node.is_directory&&e.expanded&&(e.loadedChildren.length>0||((i=e.node.children)==null?void 0:i.length)>0)?t("div",{staticClass:"children"},e._l(e.loadedChildren.length>0?e.loadedChildren:e.node.children,function(n){return t("file-select-tree-node",{key:n.path,attrs:{node:n,level:e.level+1,"selected-path":e.selectedPath},on:{select:function(r){return e.$emit("select",r)},"enter-dir":function(r){return e.$emit("enter-dir",r)},"load-children":function(r){return e.$emit("load-children",r)}}})}),1):e._e()])},EAe=[],TAe=en(DAe,IAe,EAe,!1,null,"fac31aa5");const NAe=TAe.exports,MAe=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/code`;let rr=null,yg=null,K2=0;const RAe=10,PAe=1e3,iI=new Map;let bA=new Map,nI=null;const OAe=5e3;function AAe(s){return iI.has(s)||iI.set(s,[]),iI.get(s)}function FAe(s){const{type:e}=s,t=iI.get(e)||[];for(const i of t)try{i(s)}catch(n){console.error("WebSocket listener error:",n)}}function kU(){if(!(rr&&rr.readyState===WebSocket.OPEN))try{rr=new WebSocket(MAe),rr.onopen=()=>{console.log("[WS] Connected"),K2=0,yg&&(clearTimeout(yg),yg=null),WAe()},rr.onmessage=s=>{try{const e=JSON.parse(s.data);FAe(e)}catch(e){console.error("[WS] Parse error:",e)}},rr.onclose=()=>{console.log("[WS] Closed"),rr=null,tve(),Zle()},rr.onerror=s=>{console.error("[WS] Error:",s)}}catch(s){console.error("[WS] Connection error:",s),Zle()}}function Zle(){if(K2>=RAe){console.log("[WS] Max reconnect attempts reached");return}if(yg)return;const s=PAe*Math.pow(2,K2);K2++,yg=setTimeout(()=>{yg=null,kU()},s)}function BAe(){tve(),yg&&(clearTimeout(yg),yg=null),rr&&(rr.close(),rr=null)}function Xle(s,e){return rr&&rr.readyState===WebSocket.OPEN?(rr.send(JSON.stringify({type:s,data:e})),!0):!1}function Qle(){return rr&&rr.readyState===WebSocket.OPEN}function WAe(){nI||(nI=setInterval(()=>{rr&&rr.readyState===WebSocket.OPEN&&rr.send(JSON.stringify({type:"get_running_sessions",data:{}}))},OAe),rr&&rr.readyState===WebSocket.OPEN&&rr.send(JSON.stringify({type:"get_running_sessions",data:{}})))}function tve(){nI&&(clearInterval(nI),nI=null)}const Cd={connect:kU,disconnect:BAe,send:Xle,isConnected:Qle,on(s,e){const t=AAe(s);return t.push(e),()=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)}},off(s,e){const t=iI.get(s)||[],i=t.indexOf(e);i>-1&&t.splice(i,1)},subscribe(s,e){console.log(`[WS] Subscribing to session ${s} with handlers:`,Object.keys(e)),bA.has(s)&&bA.get(s)();const t=[],i=["todos","session","step","compact","done","stopped","error"],n=["running_sessions"];for(const o of i){const a=e[o];a&&t.push(this.on(o,l=>{var h;(l.sessionId||((h=l.data)==null?void 0:h.sessionId))===s&&a(l.data||l,l)}))}for(const o of n){const a=e[o];a&&t.push(this.on(o,l=>{a(l.data||l,l)}))}e.running_sessions&&Qle()&&Xle("get_running_sessions",{});const r=()=>{t.forEach(o=>o()),bA.delete(s)};return bA.set(s,r),r},init(){kU()}},Wv="/api";let Ep=new Map;async function Ye(s,e,t=null){const i={method:s,headers:{"Content-Type":"application/json"}};t&&s!=="GET"&&(i.body=JSON.stringify(t));const r=await(await fetch(`${Wv}${e}`,i)).json();if(r.success===!1)throw new Error(r.error||r.message||"请求失败");return r}const Yt={getSessions(s=20,e=0){return Ye("GET",`/session/list_session?limit=${s}&offset=${e}`)},createSession(s="新会话",e=null){return Ye("POST","/session/create_session",{title:s,projectPath:e})},getSession(s){return Ye("GET",`/session/detail_session?id=${s}`)},updateSession(s,e){return Ye("POST","/session/update_session",{id:s,...e})},deleteSession(s){return Ye("POST","/session/delete_session",{id:s})},getSessionStatuses(s){return Ye("POST","/session/status_session",{sessionIds:s})},getMessages(s){return Ye("GET",`/chat/history_chat?sessionId=${s}`)},getProviders(){return Ye("GET","/sys_config/list_providers_config")},getProvider(s){return Ye("GET",`/sys_config/detail_provider_config?id=${s}`)},addProvider(s){return Ye("POST","/sys_config/create_provider_config",s)},updateProvider(s,e){return Ye("POST","/sys_config/update_provider_config",{id:s,...e})},deleteProvider(s){return Ye("POST","/sys_config/delete_provider_config",{id:s})},setDefaultProvider(s){return Ye("POST","/sys_config/set_default_provider_config",{id:s})},getModels(){return Ye("GET","/sys_config/list_models_config")},getModelsByProvider(s){return Ye("GET",`/sys_config/list_models_config?providerId=${s}`)},addModel(s){return Ye("POST","/sys_config/create_model_config",s)},updateModel(s,e){return Ye("POST","/sys_config/update_model_config",{id:s,...e})},deleteModel(s){return Ye("POST","/sys_config/delete_model_config",{id:s})},chat(s){return Ye("POST","/chat/send_chat",s)},chatCommand(s,e){return Ye("POST","/chat/command_chat",{message:s,sessionId:e})},uploadChatImage(s,e){const t=new FormData;return t.append("image",s),t.append("sessionId",e),fetch(`${Wv}/chat/upload_image_chat`,{method:"POST",body:t}).then(i=>i.json())},getSkills(){return Ye("GET","/skill/list_skill")},getSkillRepositories(){return Ye("GET","/skill/repositories_skill")},createSkillRepository(s){return Ye("POST","/skill/create_repo_skill",s)},updateSkillRepository(s,e){return Ye("POST","/skill/update_repo_skill",{id:s,...e})},deleteSkillRepository(s){return Ye("POST","/skill/delete_repo_skill",{id:s})},syncSkillRepository(s){return Ye("POST","/skill/sync_repo_skill",{id:s})},getRemoteSkills(s){return Ye("GET",`/skill/repositories_skill?repoId=${s}`)},downloadSkill(s,e,t){return Ye("POST","/skill/download_repo_skill",{repoId:s,skillName:e,projectPath:t})},downloadAllSkills(s,e){return Ye("POST","/skill/download_repo_skill",{repoId:s,all:!0,projectPath:e})},getLocalSkills(s){const e=s?`?projectPath=${encodeURIComponent(s)}`:"";return Ye("GET",`/skill/local_skill${e}`)},getSkillContent(s){return Ye("GET",`/skill/detail_skill?name=${encodeURIComponent(s)}`)},deleteLocalSkill(s){return Ye("POST","/skill/load_skill",{name:s,action:"delete"})},getConfig(s){return Ye("GET",`/sys_config/get_config?key=${encodeURIComponent(s)}`)},setConfig(s,e){return Ye("POST","/sys_config/set_config",{key:s,value:e})},getProxyConfig(){return Ye("GET","/sys_config/proxy_config")},updateProxyConfig(s){return Ye("POST","/sys_config/proxy_config",s)},getFileTree(s="/"){return Ye("GET",`/file/tree_file?path=${encodeURIComponent(s)}`)},getFileContent(s){return Ye("GET",`/file/content_file?path=${encodeURIComponent(s)}`)},writeFile(s,e){return Ye("POST","/file/write_file",{path:s,content:e})},editFile(s,e,t){return Ye("POST","/file/edit_file",{path:s,oldString:e,newString:t})},deleteFile(s){return Ye("POST","/file/delete_file",{filePath:s})},writeFile(s,e){return Ye("POST","/file/write_file",{filePath:s,content:e})},editFile(s,e,t){return Ye("POST","/file/edit_file",{filePath:s,oldString:e,newString:t})},createDirectory(s){return Ye("POST","/file/mkdir_file",{filePath:s})},renameFile(s,e){return Ye("POST","/file/rename_file",{oldPath:s,newPath:e})},browseFilesystem(s=""){return Ye("GET",`/file/browse_file?path=${encodeURIComponent(s)}`)},async uploadFilesystem(s,e){const t=new FormData;t.append("file",e),t.append("targetDir",s),t.append("filename",encodeURIComponent(e.name));const n=await(await fetch(`${Wv}/file/upload_file`,{method:"POST",body:t})).json();if(n.success===!1)throw new Error(n.error||n.message||"上传失败");return n},uploadFilesystemWithProgress(s,e,t){const n=Math.ceil(e.size/10485760),r=Date.now()+"-"+Math.round(Math.random()*1e9);return(async()=>{for(let l=0;l<n;l++){const d=l*10485760,h=Math.min(d+10485760,e.size),f=e.slice(d,h);await this.uploadChunk(r,l,n,e.name,s,f),t&&t(Math.round((l+1)/n*95))}const a=await this.mergeChunks(r);return t&&t(100),a})()},uploadChunk(s,e,t,i,n,r){const o=new FormData;return o.append("uploadId",s),o.append("chunkIndex",String(e)),o.append("totalChunks",String(t)),o.append("fileName",encodeURIComponent(i)),o.append("targetDir",n),o.append("chunk",r),fetch(`${Wv}/file/upload_chunk_file`,{method:"POST",body:o}).then(a=>a.json()).then(a=>{if(a.success===!1)throw new Error(a.error||"上传分片失败");return a})},mergeChunks(s){return Ye("POST","/file/upload_merge_file",{uploadId:s})},downloadFilesystemWithProgress(s,e,t){const i=`${Wv}/file/download_file?path=${encodeURIComponent(s)}`;return fetch(i).then(n=>{if(!n.ok)throw new Error("下载失败: HTTP "+n.status);const r=n.headers.get("Content-Length"),o=r?parseInt(r,10):0,a=n.body.getReader(),l=[];let d=0;const h=()=>a.read().then(({done:f,value:p})=>{if(f){const m=new Blob(l),v=URL.createObjectURL(m),b=document.createElement("a");return b.href=v,b.download=e,document.body.appendChild(b),b.click(),document.body.removeChild(b),URL.revokeObjectURL(v),{success:!0}}return l.push(p),d+=p.length,o>0&&t&&t(Math.round(d/o*100)),h()});return h()})},async saveFile(s,e){return Ye("POST","/file/write_file",{filePath:s,content:Array.from(new Uint8Array(e))})},removeFile(s){return Ye("POST","/file/delete_file",{filePath:s})},moveFile(s,e){return Ye("POST","/file/rename_file",{oldPath:s,newPath:e})},getDrives(){return Ye("GET","/file/drives_file")},getCwd(){return Ye("GET","/file/browse_file?path=.")},getDbTables(){return Ye("GET","/db/tables_db")},getTableInfo(s){return Ye("GET",`/db/schema_db?name=${encodeURIComponent(s)}`)},getTableData(s,e=1,t=50){return Ye("GET",`/db/data_db?name=${encodeURIComponent(s)}&page=${e}&pageSize=${t}`)},getTableDataRaw(s,e=100){return Ye("GET",`/db/data_db?name=${encodeURIComponent(s)}&limit=${e}`)},executeSql(s){return Ye("POST","/db/data_db",{query:s})},getAiCallLogs(s=1,e=50){return Ye("GET",`/ai_log/list_ai_log?page=${s}&pageSize=${e}`)},getScheduledTasks(){return Ye("GET","/scheduler/list_scheduler")},getScheduledTask(s){return Ye("GET",`/scheduler/logs_scheduler?id=${s}`)},createScheduledTask(s){return Ye("POST","/scheduler/create_scheduler",s)},updateScheduledTask(s,e){return Ye("POST","/scheduler/update_scheduler",{id:s,...e})},deleteScheduledTask(s){return Ye("POST","/scheduler/delete_scheduler",{id:s})},startScheduledTask(s){return Ye("POST","/scheduler/start_scheduler",{id:s})},stopScheduledTask(s){return Ye("POST","/scheduler/stop_scheduler",{id:s})},runTaskNow(s){return Ye("POST","/scheduler/run_scheduler",{id:s})},getTaskLogs(s,e=50){return Ye("GET",`/scheduler/logs_scheduler?id=${s}&limit=${e}`)},ws:Cd,sessionWsSend(s,e,t){return Cd.send(e,t)},wsIsConnected(){return Cd.isConnected()},wsSubscribe(s,e){return Cd.subscribe(s,e)},getEmailConfigs(){return Ye("GET","/email/list_email")},getEmailConfig(s){return Ye("GET",`/email/detail_email?id=${s}`)},createEmailConfig(s){return Ye("POST","/email/create_email",s)},updateEmailConfig(s,e){return Ye("POST","/email/update_email",{id:s,...e})},deleteEmailConfig(s){return Ye("POST","/email/delete_email",{id:s})},setDefaultEmailConfig(s){return Ye("POST","/email/set_default_email",{id:s})},validateEmailConfig(s){return Ye("POST","/email/validate_email",{configId:s})},getDingtalkConfig(){return Ye("GET","/dingtalk/config_dingtalk")},updateDingtalkConfig(s){return Ye("POST","/dingtalk/config_dingtalk",s)},startDingtalk(){return Ye("POST","/dingtalk/start_dingtalk")},stopDingtalk(){return Ye("POST","/dingtalk/stop_dingtalk")},getGatewayStatus(){return Ye("GET","/dingtalk/status_dingtalk")},getQueueStatus(){return Ye("GET","/gateway/queue_gateway")},getWafConfig(){return Ye("GET","/gateway/waf_config_gateway")},updateWafConfig(s){return Ye("POST","/gateway/waf_update_gateway",s)},startWaf(){return Ye("POST","/gateway/waf_start_gateway")},stopWaf(){return Ye("POST","/gateway/waf_stop_gateway")},getWafStatus(){return Ye("GET","/gateway/waf_status_gateway")},getTerminalSessions(){return Ye("GET","/terminal/list_terminal")},createTerminalSession(){return Ye("POST","/terminal/create_terminal")},deleteTerminalSession(s){return Ye("POST","/terminal/delete_terminal",{id:s})},terminalWsConnect(s,e,t,i,n){if(Ep.has(s)){const l=Ep.get(s);if(l.readyState===WebSocket.OPEN)return l}const o=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal/${s}`,a=new WebSocket(o);return a.onopen=()=>{console.log(`Terminal WebSocket [${s}] connected`),t&&t()},a.onmessage=l=>{try{const d=JSON.parse(l.data);e&&e(d)}catch(d){console.error("Terminal WebSocket parse error:",d)}},a.onclose=()=>{console.log(`Terminal WebSocket [${s}] closed`),Ep.delete(s),i&&i()},a.onerror=l=>{console.error(`Terminal WebSocket [${s}] error:`,l),n&&n(l)},Ep.set(s,a),a},terminalWsDisconnect(s){const e=Ep.get(s);e&&(e.close(),Ep.delete(s))},terminalWsSend(s,e,t){const i=Ep.get(s);return i&&i.readyState===WebSocket.OPEN?(i.send(JSON.stringify({type:e,data:t})),!0):!1},terminalWsIsConnected(s){const e=Ep.get(s);return e&&e.readyState===WebSocket.OPEN},getWorkflowState(){return Ye("GET","/workflow/state_workflow")},updateWorkflowState(s,e,t){return Ye("POST","/workflow/update_workflow",{currentCategory:s,currentProject:e,currentStep:t})},gitIsRepo(){return Ye("GET","/git/is_repo_git")},gitStatus(){return Ye("GET","/git/status_git")},gitDiff(s,e){let t=`/git/diff_git?file=${encodeURIComponent(s)}`;return e&&(t+="&isNew=true"),Ye("GET",t)},gitRevert(s){return Ye("POST","/git/revert_git",{file:s})},gitRevertAll(){return Ye("POST","/git/revert_all_git")},gitDeleteFile(s){return Ye("POST","/git/delete_file_git",{file:s})},gitDiscardUntracked(){return Ye("POST","/git/discard_untracked_git")},getCustomActions(s){const e=s?`?type=${s}`:"";return Ye("GET",`/custom_action/list_custom_action${e}`)},createCustomAction(s){return Ye("POST","/custom_action/create_custom_action",s)},updateCustomAction(s,e){return Ye("POST","/custom_action/update_custom_action",{id:s,...e})},deleteCustomAction(s){return Ye("POST","/custom_action/delete_custom_action",{id:s})},getLocalSpecs(s){const e=s?`?projectPath=${encodeURIComponent(s)}`:"";return Ye("GET",`/spec/local_spec${e}`)},getSpecContent(s){return Ye("GET",`/spec/detail_spec?name=${encodeURIComponent(s)}`)},deleteLocalSpec(s){return Ye("POST","/spec/delete_spec",{name:s})},uploadSpec(s,e){return Ye("POST","/spec/upload_spec",{name:s,content:e})},getSpecRepositories(){return Ye("GET","/spec/repositories_spec")},createSpecRepository(s){return Ye("POST","/spec/create_repo_spec",s)},updateSpecRepository(s,e){return Ye("POST","/spec/update_repo_spec",{id:s,...e})},deleteSpecRepository(s){return Ye("POST","/spec/delete_repo_spec",{id:s})},getRepoSpecs(s){return Ye("GET",`/spec/repositories_spec?repoId=${s}`)},syncSpecRepository(s){return Ye("POST","/spec/sync_repo_spec",{repoId:s})},downloadSpec(s,e,t){return Ye("POST","/spec/download_repo_spec",{repoId:s,specName:e,projectPath:t})},downloadAll(s,e){return Ye("POST","/spec/download_repo_spec",{repoId:s,all:!0,projectPath:e})},downloadAllSpecs(s,e){return Ye("POST","/spec/download_repo_spec",{repoId:s,all:!0,projectPath:e})},getProjectPath(){return Ye("GET","/project/current_project")},getWikiMenu(){return Ye("GET","/wiki/menu_wiki")},getWikiContent(s){return Ye("GET",`/wiki/content_wiki?path=${encodeURIComponent(s)}`)},getWikiAsset(s){return`${Wv}/wiki/asset_wiki?path=${encodeURIComponent(s)}`},getMemory(s){const e=s?`?projectPath=${encodeURIComponent(s)}`:"";return Ye("GET",`/memory/get_memory${e}`)},saveMemory(s,e){return Ye("POST","/memory/save_memory",{projectPath:s,content:e})},getProjects(){return Ye("GET","/project/list_project")},getCurrentProject(){return Ye("GET","/project/current_project")},setCurrentProject(s){return Ye("POST","/project/set_current_project",{id:s})},createProject(s,e,t=""){return Ye("POST","/project/create_project",{name:s,path:e,description:t})},exportConfig(){return fetch(`${Wv}/sys_config/export_config`,{method:"GET"}).then(s=>{if(!s.ok)throw new Error("导出失败");return s.blob()})},importConfig(s){return Ye("POST","/sys_config/import_config",{content:s})},getSystemInfo(){return Ye("GET","/system/info_system")}},VAe={name:"FileSelectDialog",components:{FileSelectTreeNode:NAe},props:{visible:{type:Boolean,default:!1}},data(){return{loading:!1,currentPath:"",selectedPath:"",parentPath:null,fileTreeData:[]}},computed:{canGoUp(){return this.parentPath!==null&&this.parentPath!==""}},methods:{async loadFileTree(s=""){var e,t,i;this.loading=!0;try{const n=await Yt.browseFilesystem(s);this.currentPath=((e=n.data)==null?void 0:e.current_path)||s,this.parentPath=(t=n.data)==null?void 0:t.parent_path;const r=(((i=n.data)==null?void 0:i.items)||[]).map(o=>this.transformNode(o));r.sort((o,a)=>o.is_directory===a.is_directory?o.name.localeCompare(a.name):o.is_directory?-1:1),this.fileTreeData=r}catch(n){console.error("Load file tree failed:",n),this.fileTreeData=[]}finally{this.loading=!1}},transformNode(s){return{name:s.name,path:s.path,is_directory:s.is_directory,is_drive:s.is_drive||!1,size:s.size,has_children:s.is_directory,expanded:!1,children:[]}},handleSelect(s){this.selectedPath=s.path},handleConfirm(){this.selectedPath&&(this.$emit("select",this.selectedPath),this.$emit("update:visible",!1))},async handleLoadChildren({path:s,callback:e}){var t;try{const n=(((t=(await Yt.browseFilesystem(s)).data)==null?void 0:t.items)||[]).map(r=>this.transformNode(r));n.sort((r,o)=>r.is_directory===o.is_directory?r.name.localeCompare(o.name):r.is_directory?-1:1),e(n)}catch(i){console.error("Load children failed:",i),e([])}},goUp(){this.parentPath!==null&&this.loadFileTree(this.parentPath===""?"":this.parentPath)},goHome(){this.loadFileTree("")},refresh(){this.loadFileTree(this.currentPath||"")},handleClose(){this.$emit("close")},handleVisibleChange(s){this.$emit("update:visible",s)},open(){this.loadFileTree("")}},watch:{visible(s){s&&this.loadFileTree("")}}};var HAe=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{visible:e.visible,title:"选择文件",width:"500px","close-on-click-modal":!1},on:{"update:visible":e.handleVisibleChange,close:e.handleClose}},[t("div",{staticClass:"file-select-content"},[t("div",{staticClass:"file-tree-container"},[e._l(e.fileTreeData,function(i){return t("file-select-tree-node",{key:i.path,attrs:{node:i,level:0,"selected-path":e.selectedPath},on:{select:e.handleSelect,"load-children":e.handleLoadChildren}})}),e.loading?t("div",{staticClass:"empty-files"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.fileTreeData.length===0?t("div",{staticClass:"empty-files"},[e._v(" 此目录为空 ")]):e._e()],2),t("div",{staticClass:"file-select-footer"},[t("span",{staticClass:"selected-path"},[e._v(e._s(e.selectedPath||"未选择"))]),t("button",{staticClass:"confirm-btn",attrs:{disabled:!e.selectedPath},on:{click:e.handleConfirm}},[e._v("选择")])])])])},$Ae=[],zAe=en(VAe,HAe,$Ae,!1,null,"f89667ec");const jAe=zAe.exports,UAe={name:"SkillSelectDialog",props:{visible:{type:Boolean,default:!1}},data(){return{loading:!1,skills:[],selectedSkill:"",searchText:""}},computed:{filteredSkills(){if(!this.searchText)return this.skills;const s=this.searchText.toLowerCase();return this.skills.filter(e=>e.name.toLowerCase().includes(s)||e.description&&e.description.toLowerCase().includes(s))}},watch:{visible(s){s&&(this.loadSkills(),this.selectedSkill="",this.searchText="")}},methods:{async loadSkills(){this.loading=!0;try{const s=await Yt.getSkills();this.skills=s.data||[]}catch(s){console.error("Load skills failed:",s),this.skills=[]}finally{this.loading=!1,this.$nextTick(()=>{const s=this.$refs.searchInput;s&&s.focus()})}},handleConfirm(){this.selectedSkill&&(this.$emit("select",this.selectedSkill),this.$emit("update:visible",!1))},handleClose(){this.$emit("close")},handleVisibleChange(s){this.$emit("update:visible",s)}}};var qAe=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{visible:e.visible,title:"选择 Skill",width:"420px","close-on-click-modal":!1},on:{"update:visible":e.handleVisibleChange,close:e.handleClose}},[t("div",{staticClass:"skill-select-content"},[t("div",{staticClass:"skill-search"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.searchText,expression:"searchText"}],ref:"searchInput",staticClass:"search-input",attrs:{placeholder:"搜索 Skill..."},domProps:{value:e.searchText},on:{input:function(i){i.target.composing||(e.searchText=i.target.value)}}})]),t("div",{staticClass:"skill-list-container"},[e.loading?t("div",{staticClass:"empty-state"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.filteredSkills.length===0?t("div",{staticClass:"empty-state"},[e._v(" "+e._s(e.searchText?"无匹配 Skill":"无可用 Skill")+" ")]):e._e(),e._l(e.filteredSkills,function(i){return t("div",{key:i.name,staticClass:"skill-item",class:{"skill-selected":e.selectedSkill===i.name},on:{click:function(n){e.selectedSkill=i.name},dblclick:e.handleConfirm}},[t("div",{staticClass:"skill-name"},[e._v(e._s(i.name))]),i.description?t("div",{staticClass:"skill-desc"},[e._v(e._s(i.description))]):e._e()])})],2),t("div",{staticClass:"skill-select-footer"},[t("span",{staticClass:"selected-skill"},[e._v(e._s(e.selectedSkill||"未选择"))]),t("button",{staticClass:"confirm-btn",attrs:{disabled:!e.selectedSkill},on:{click:e.handleConfirm}},[e._v("选择")])])])])},KAe=[],GAe=en(UAe,qAe,KAe,!1,null,"129ba93f");const YAe=GAe.exports,ZAe={name:"ModelSelectDialog",props:{visible:{type:Boolean,default:!1},currentModel:{type:String,default:""}},data(){return{models:[],loading:!1}},computed:{selectedModelName(){return this.currentModel}},watch:{visible(s){s&&this.loadModels()}},methods:{open(){this.loadModels()},async loadModels(){this.loading=!0;try{const s=await Yt.getModels();this.models=s.data||[]}catch(s){console.error("加载模型列表失败:",s),this.models=[]}finally{this.loading=!1}},handleSelect(s){this.$emit("select",s),this.$emit("update:visible",!1)},handleClose(){this.$emit("close")},handleVisibleChange(s){this.$emit("update:visible",s)}}};var XAe=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{visible:e.visible,title:"选择模型",width:"400px"},on:{"update:visible":e.handleVisibleChange,close:e.handleClose}},[t("div",{staticClass:"model-list"},[e._l(e.models,function(i){return t("div",{key:i.id,staticClass:"model-item",class:{active:e.selectedModelName===i.name},on:{click:function(n){return e.handleSelect(i)}}},[t("span",{staticClass:"model-name"},[e._v(e._s(i.name))]),t("span",{staticClass:"model-provider"},[e._v(e._s(i.providerId))])])}),e.loading?t("div",{staticClass:"empty-models"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.models.length===0?t("div",{staticClass:"empty-models"},[e._v(" 暂无可用模型 ")]):e._e()],2)])},QAe=[],JAe=en(ZAe,XAe,QAe,!1,null,"96e8b517");const e2e=JAe.exports,t2e={name:"CommandDialog",props:{visible:{type:Boolean,default:!1}},data(){return{loading:!1,selectedCommand:"",commands:[{name:"/compact",description:"压缩当前会话上下文"}]}},methods:{open(){},handleExecute(s){this.$emit("execute",s.name),this.$emit("update:visible",!1)},handleClose(){this.$emit("close")},handleVisibleChange(s){this.$emit("update:visible",s)}}};var i2e=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{visible:e.visible,title:"命令",width:"500px","close-on-click-modal":!1},on:{"update:visible":e.handleVisibleChange,close:e.handleClose}},[t("div",{staticClass:"command-list"},[e._l(e.commands,function(i){return t("div",{key:i.name,staticClass:"command-item",class:{selected:e.selectedCommand===i.name},attrs:{title:"双击执行: "+i.name},on:{click:function(n){e.selectedCommand=i.name},dblclick:function(n){return e.handleExecute(i)}}},[t("span",{staticClass:"command-name"},[e._v(e._s(i.name))]),t("span",{staticClass:"command-desc"},[e._v(e._s(i.description))])])}),e.loading?t("div",{staticClass:"empty-commands"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e._e()],2)])},n2e=[],s2e=en(t2e,i2e,n2e,!1,null,"439b4563");const r2e=s2e.exports,o2e={name:"ResizableTextarea",props:{value:{type:String,default:""},rows:{type:Number,default:5},minRows:{type:Number,default:2},maxRows:{type:Number,default:20}},data(){return{internalValue:this.value,currentRows:this.rows,isResizing:!1,isHovering:!1,startY:0,startRows:0}},computed:{showHandle(){return!0}},watch:{value(s){this.internalValue=s},internalValue(s){this.$emit("input",s)}},mounted(){document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.stopResize),this.$nextTick(()=>{var e;const s=(e=this.$el)==null?void 0:e.querySelector("textarea");s&&s.addEventListener("paste",this.handlePaste)})},beforeDestroy(){var e;document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.stopResize);const s=(e=this.$el)==null?void 0:e.querySelector("textarea");s&&s.removeEventListener("paste",this.handlePaste)},methods:{handleMouseEnter(){this.isHovering=!0},handleMouseLeave(){this.isResizing||(this.isHovering=!1)},startResize(s){this.isResizing=!0,this.isHovering=!1,this.startY=s.clientY,this.startRows=this.currentRows,document.body.style.cursor="ns-resize",document.body.style.userSelect="none"},handleMouseMove(s){if(!this.isResizing)return;const e=this.startY-s.clientY,i=Math.round(this.startRows+e/20);this.currentRows=Math.max(this.minRows,Math.min(this.maxRows,i))},stopResize(){this.isResizing&&(this.isResizing=!1,document.body.style.cursor="",document.body.style.userSelect="")},handlePaste(s){var i;const e=(i=s.clipboardData)==null?void 0:i.items;if(!e)return;const t=[];for(const n of e)n.type.startsWith("image/")&&t.push(n.getAsFile());t.length>0&&(s.preventDefault(),this.$emit("paste-image",t))}}};var a2e=function(){var e=this,t=e._self._c;return t("div",{staticClass:"resizable-textarea-outer",class:{"resize-hand-active":e.isResizing}},[e.showHandle?t("div",{staticClass:"resize-hand",on:{mousedown:e.startResize,mouseenter:e.handleMouseEnter,mouseleave:e.handleMouseLeave}}):e._e(),t("el-input",e._b({attrs:{type:"textarea",rows:e.currentRows},model:{value:e.internalValue,callback:function(i){e.internalValue=i},expression:"internalValue"}},"el-input",e.$attrs,!1)),e.showHandle&&e.isHovering?t("div",{staticClass:"resize-indicator"}):e._e()],1)},l2e=[],c2e=en(o2e,a2e,l2e,!1,null,"16456784");const d2e=c2e.exports,u2e={name:"ImagePreviewList",props:{files:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}}};var h2e=function(){var e=this,t=e._self._c;return t("div",{staticClass:"image-preview-list"},e._l(e.files,function(i){return t("div",{key:i.id,staticClass:"image-preview-item"},[t("img",{staticClass:"thumbnail",attrs:{src:i.dataUrl}}),i.uploading?t("div",{staticClass:"upload-loading"},[t("span",{staticClass:"loading-spinner"})]):t("button",{staticClass:"remove-btn",attrs:{disabled:e.disabled},on:{click:function(n){return e.$emit("remove",i.id)}}},[e._v("×")])])}),0)},f2e=[],g2e=en(u2e,h2e,f2e,!1,null,"8e2530ba");const p2e=g2e.exports,m2e="/api";async function Ty(s,e,t=null){const i={method:s,headers:{"Content-Type":"application/json"}};t&&s!=="GET"&&(i.body=JSON.stringify(t));const r=await(await fetch(`${m2e}${e}`,i)).json();if(r.success===!1)throw new Error(r.error||r.message||"请求失败");return r}async function ive(s=20,e=0){return Ty("GET",`/session/list_session?limit=${s}&offset=${e}`)}async function nve(s="新会话",e=null){return Ty("POST","/session/create_session",{title:s,projectPath:e})}async function _2e(s,e){return Ty("POST","/session/update_session",{id:s,...e})}async function v2e(s){return Ty("POST","/session/delete_session",{id:s})}async function sve(s){return Ty("GET",`/chat/history_chat?sessionId=${s}`)}async function b2e(s){return Ty("GET",`/sys_config/get_config?key=${encodeURIComponent(s)}`)}async function C2e(s,e){return Ty("POST","/sys_config/set_config",{key:s,value:e})}const y2e="/api";async function w2e(s){const e=new FormData;e.append("file",s);const i=await(await fetch(`${y2e}/chat/upload_image_chat`,{method:"POST",body:e})).json();if(i.success===!1)throw new Error(i.error||"上传失败");return i}function S2e(s){var n;const e=s.input.trim(),t=s.chatMode==="plan"?`【计划模式】禁止修改任何代码,仅对用户输入进行分析并输出分析结果。
|
|
143
143
|
|
|
144
144
|
用户输入:${e}`:e,i=(s.mediaFiles||[]).filter(r=>!r.uploading&&r.filePath);return{message:t,sessionId:(n=s.session)==null?void 0:n.id,modelName:s.modelName||void 0,enableDevLog:s.enableDevLog,mediaFiles:i.map(r=>({filePath:r.filePath,type:r.type}))}}async function x2e(s){const e=await new Promise((i,n)=>{const r=new FileReader;r.onload=()=>i(r.result),r.onerror=n,r.readAsDataURL(s)}),t=await w2e(s);return{dataUrl:e,filePath:t.data.filePath,type:t.data.filePath.endsWith(".png")?"image/png":s.type||"image/jpeg"}}function nee(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ny=nee();function rve(s){Ny=s}var Jv={exec:()=>null};function wn(s,e=""){let t=typeof s=="string"?s:s.source,i={replace:(n,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(tl.caret,"$1"),t=t.replace(n,o),i},getRegex:()=>new RegExp(t,e)};return i}var k2e=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),tl={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}#`),htmlBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}>`)},L2e=/^(?:[ \t]*(?:\n|$))+/,D2e=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,I2e=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,dN=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,E2e=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,see=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ove=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ave=wn(ove).replace(/bull/g,see).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),T2e=wn(ove).replace(/bull/g,see).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ree=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,N2e=/^[^\n]+/,oee=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,M2e=wn(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",oee).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),R2e=wn(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,see).getRegex(),gV="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",aee=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,P2e=wn("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",aee).replace("tag",gV).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),lve=wn(ree).replace("hr",dN).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",gV).getRegex(),O2e=wn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",lve).getRegex(),lee={blockquote:O2e,code:D2e,def:M2e,fences:I2e,heading:E2e,hr:dN,html:P2e,lheading:ave,list:R2e,newline:L2e,paragraph:lve,table:Jv,text:N2e},Jle=wn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",dN).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",gV).getRegex(),A2e={...lee,lheading:T2e,table:Jle,paragraph:wn(ree).replace("hr",dN).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Jle).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",gV).getRegex()},F2e={...lee,html:wn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",aee).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Jv,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:wn(ree).replace("hr",dN).replace("heading",` *#{1,6} *[^
|
|
145
145
|
]`).replace("lheading",ave).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},B2e=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,W2e=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,cve=/^( {2,}|\\)\n(?!\s*$)/,V2e=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,kx=/[\p{P}\p{S}]/u,pV=/[\s\p{P}\p{S}]/u,cee=/[^\s\p{P}\p{S}]/u,H2e=wn(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,pV).getRegex(),dve=/(?!~)[\p{P}\p{S}]/u,$2e=/(?!~)[\s\p{P}\p{S}]/u,z2e=/(?:[^\s\p{P}\p{S}]|~)/u,j2e=wn(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",k2e?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),uve=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,U2e=wn(uve,"u").replace(/punct/g,kx).getRegex(),q2e=wn(uve,"u").replace(/punct/g,dve).getRegex(),hve="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",K2e=wn(hve,"gu").replace(/notPunctSpace/g,cee).replace(/punctSpace/g,pV).replace(/punct/g,kx).getRegex(),G2e=wn(hve,"gu").replace(/notPunctSpace/g,z2e).replace(/punctSpace/g,$2e).replace(/punct/g,dve).getRegex(),Y2e=wn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,cee).replace(/punctSpace/g,pV).replace(/punct/g,kx).getRegex(),Z2e=wn(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,kx).getRegex(),X2e="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Q2e=wn(X2e,"gu").replace(/notPunctSpace/g,cee).replace(/punctSpace/g,pV).replace(/punct/g,kx).getRegex(),J2e=wn(/\\(punct)/,"gu").replace(/punct/g,kx).getRegex(),eFe=wn(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),tFe=wn(aee).replace("(?:-->|$)","-->").getRegex(),iFe=wn("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",tFe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),n4=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,nFe=wn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",n4).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),fve=wn(/^!?\[(label)\]\[(ref)\]/).replace("label",n4).replace("ref",oee).getRegex(),gve=wn(/^!?\[(ref)\](?:\[\])?/).replace("ref",oee).getRegex(),sFe=wn("reflink|nolink(?!\\()","g").replace("reflink",fve).replace("nolink",gve).getRegex(),ece=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,dee={_backpedal:Jv,anyPunctuation:J2e,autolink:eFe,blockSkip:j2e,br:cve,code:W2e,del:Jv,delLDelim:Jv,delRDelim:Jv,emStrongLDelim:U2e,emStrongRDelimAst:K2e,emStrongRDelimUnd:Y2e,escape:B2e,link:nFe,nolink:gve,punctuation:H2e,reflink:fve,reflinkSearch:sFe,tag:iFe,text:V2e,url:Jv},rFe={...dee,link:wn(/^!?\[(label)\]\((.*?)\)/).replace("label",n4).getRegex(),reflink:wn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",n4).getRegex()},LU={...dee,emStrongRDelimAst:G2e,emStrongLDelim:q2e,delLDelim:Z2e,delRDelim:Q2e,url:wn(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ece).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:wn(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ece).getRegex()},oFe={...LU,br:wn(cve).replace("{2,}","*").getRegex(),text:wn(LU.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},CA={normal:lee,gfm:A2e,pedantic:F2e},YL={normal:dee,gfm:LU,breaks:oFe,pedantic:rFe},aFe={"&":"&","<":"<",">":">",'"':""","'":"'"},tce=s=>aFe[s];function ph(s,e){if(e){if(tl.escapeTest.test(s))return s.replace(tl.escapeReplace,tce)}else if(tl.escapeTestNoEncode.test(s))return s.replace(tl.escapeReplaceNoEncode,tce);return s}function ice(s){try{s=encodeURI(s).replace(tl.percentDecode,"%")}catch{return null}return s}function nce(s,e){var r;let t=s.replace(tl.findPipe,(o,a,l)=>{let d=!1,h=a;for(;--h>=0&&l[h]==="\\";)d=!d;return d?"|":" |"}),i=t.split(tl.splitPipe),n=0;if(i[0].trim()||i.shift(),i.length>0&&!((r=i.at(-1))!=null&&r.trim())&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(tl.slashPipe,"|");return i}function ZL(s,e,t){let i=s.length;if(i===0)return"";let n=0;for(;n<i&&s.charAt(i-n-1)===e;)n++;return s.slice(0,i-n)}function lFe(s,e){if(s.indexOf(e[1])===-1)return-1;let t=0;for(let i=0;i<s.length;i++)if(s[i]==="\\")i++;else if(s[i]===e[0])t++;else if(s[i]===e[1]&&(t--,t<0))return i;return t>0?-2:-1}function cFe(s,e=0){let t=e,i="";for(let n of s)if(n===" "){let r=4-t%4;i+=" ".repeat(r),t+=r}else i+=n,t++;return i}function sce(s,e,t,i,n){let r=e.href,o=e.title||null,a=s[1].replace(n.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:s[0].charAt(0)==="!"?"image":"link",raw:t,href:r,title:o,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,l}function dFe(s,e,t){let i=s.match(t.other.indentCodeCompensation);if(i===null)return e;let n=i[1];return e.split(`
|
|
@@ -200,7 +200,7 @@ ${s}</tr>
|
|
|
200
200
|
`}tablecell(s){let e=this.parser.parseInline(s.tokens),t=s.header?"th":"td";return(s.align?`<${t} align="${s.align}">`:`<${t}>`)+e+`</${t}>
|
|
201
201
|
`}strong({tokens:s}){return`<strong>${this.parser.parseInline(s)}</strong>`}em({tokens:s}){return`<em>${this.parser.parseInline(s)}</em>`}codespan({text:s}){return`<code>${ph(s,!0)}</code>`}br(s){return"<br>"}del({tokens:s}){return`<del>${this.parser.parseInline(s)}</del>`}link({href:s,title:e,tokens:t}){let i=this.parser.parseInline(t),n=ice(s);if(n===null)return i;s=n;let r='<a href="'+s+'"';return e&&(r+=' title="'+ph(e)+'"'),r+=">"+i+"</a>",r}image({href:s,title:e,text:t,tokens:i}){i&&(t=this.parser.parseInline(i,this.parser.textRenderer));let n=ice(s);if(n===null)return ph(t);s=n;let r=`<img src="${s}" alt="${ph(t)}"`;return e&&(r+=` title="${ph(e)}"`),r+=">",r}text(s){return"tokens"in s&&s.tokens?this.parser.parseInline(s.tokens):"escaped"in s&&s.escaped?s.text:ph(s.text)}},uee=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},fu=class IU{constructor(e){ui(this,"options");ui(this,"renderer");ui(this,"textRenderer");this.options=e||Ny,this.options.renderer=this.options.renderer||new r4,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new uee}static parse(e,t){return new IU(t).parse(e)}static parseInline(e,t){return new IU(t).parseInline(e)}parse(e){var i,n;this.renderer.parser=this;let t="";for(let r=0;r<e.length;r++){let o=e[r];if((n=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&n[o.type]){let l=o,d=this.options.extensions.renderers[l.type].call({parser:this},l);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){t+=d||"";continue}}let a=o;switch(a.type){case"space":{t+=this.renderer.space(a);break}case"hr":{t+=this.renderer.hr(a);break}case"heading":{t+=this.renderer.heading(a);break}case"code":{t+=this.renderer.code(a);break}case"table":{t+=this.renderer.table(a);break}case"blockquote":{t+=this.renderer.blockquote(a);break}case"list":{t+=this.renderer.list(a);break}case"checkbox":{t+=this.renderer.checkbox(a);break}case"html":{t+=this.renderer.html(a);break}case"def":{t+=this.renderer.def(a);break}case"paragraph":{t+=this.renderer.paragraph(a);break}case"text":{t+=this.renderer.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return t}parseInline(e,t=this.renderer){var n,r;this.renderer.parser=this;let i="";for(let o=0;o<e.length;o++){let a=e[o];if((r=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&r[a.type]){let d=this.options.extensions.renderers[a.type].call({parser:this},a);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){i+=d||"";continue}}let l=a;switch(l.type){case"escape":{i+=t.text(l);break}case"html":{i+=t.html(l);break}case"link":{i+=t.link(l);break}case"image":{i+=t.image(l);break}case"checkbox":{i+=t.checkbox(l);break}case"strong":{i+=t.strong(l);break}case"em":{i+=t.em(l);break}case"codespan":{i+=t.codespan(l);break}case"br":{i+=t.br(l);break}case"del":{i+=t.del(l);break}case"text":{i+=t.text(l);break}default:{let d='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return i}},P2,ND=(P2=class{constructor(s){ui(this,"options");ui(this,"block");this.options=s||Ny}preprocess(s){return s}postprocess(s){return s}processAllTokens(s){return s}emStrongMask(s){return s}provideLexer(){return this.block?hu.lex:hu.lexInline}provideParser(){return this.block?fu.parse:fu.parseInline}},ui(P2,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),ui(P2,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),P2),uFe=class{constructor(...s){ui(this,"defaults",nee());ui(this,"options",this.setOptions);ui(this,"parse",this.parseMarkdown(!0));ui(this,"parseInline",this.parseMarkdown(!1));ui(this,"Parser",fu);ui(this,"Renderer",r4);ui(this,"TextRenderer",uee);ui(this,"Lexer",hu);ui(this,"Tokenizer",s4);ui(this,"Hooks",ND);this.use(...s)}walkTokens(s,e){var i,n;let t=[];for(let r of s)switch(t=t.concat(e.call(this,r)),r.type){case"table":{let o=r;for(let a of o.header)t=t.concat(this.walkTokens(a.tokens,e));for(let a of o.rows)for(let l of a)t=t.concat(this.walkTokens(l.tokens,e));break}case"list":{let o=r;t=t.concat(this.walkTokens(o.items,e));break}default:{let o=r;(n=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&n[o.type]?this.defaults.extensions.childTokens[o.type].forEach(a=>{let l=o[a].flat(1/0);t=t.concat(this.walkTokens(l,e))}):o.tokens&&(t=t.concat(this.walkTokens(o.tokens,e)))}}return t}use(...s){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return s.forEach(t=>{let i={...t};if(i.async=this.defaults.async||i.async||!1,t.extensions&&(t.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let r=e.renderers[n.name];r?e.renderers[n.name]=function(...o){let a=n.renderer.apply(this,o);return a===!1&&(a=r.apply(this,o)),a}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=e[n.level];r?r.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),i.extensions=e),t.renderer){let n=this.defaults.renderer||new r4(this.defaults);for(let r in t.renderer){if(!(r in n))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let o=r,a=t.renderer[o],l=n[o];n[o]=(...d)=>{let h=a.apply(n,d);return h===!1&&(h=l.apply(n,d)),h||""}}i.renderer=n}if(t.tokenizer){let n=this.defaults.tokenizer||new s4(this.defaults);for(let r in t.tokenizer){if(!(r in n))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let o=r,a=t.tokenizer[o],l=n[o];n[o]=(...d)=>{let h=a.apply(n,d);return h===!1&&(h=l.apply(n,d)),h}}i.tokenizer=n}if(t.hooks){let n=this.defaults.hooks||new ND;for(let r in t.hooks){if(!(r in n))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let o=r,a=t.hooks[o],l=n[o];ND.passThroughHooks.has(r)?n[o]=d=>{if(this.defaults.async&&ND.passThroughHooksRespectAsync.has(r))return(async()=>{let f=await a.call(n,d);return l.call(n,f)})();let h=a.call(n,d);return l.call(n,h)}:n[o]=(...d)=>{if(this.defaults.async)return(async()=>{let f=await a.apply(n,d);return f===!1&&(f=await l.apply(n,d)),f})();let h=a.apply(n,d);return h===!1&&(h=l.apply(n,d)),h}}i.hooks=n}if(t.walkTokens){let n=this.defaults.walkTokens,r=t.walkTokens;i.walkTokens=function(o){let a=[];return a.push(r.call(this,o)),n&&(a=a.concat(n.call(this,o))),a}}this.defaults={...this.defaults,...i}}),this}setOptions(s){return this.defaults={...this.defaults,...s},this}lexer(s,e){return hu.lex(s,e??this.defaults)}parser(s,e){return fu.parse(s,e??this.defaults)}parseMarkdown(s){return(e,t)=>{let i={...t},n={...this.defaults,...i},r=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&i.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=s),n.async)return(async()=>{let o=n.hooks?await n.hooks.preprocess(e):e,a=await(n.hooks?await n.hooks.provideLexer():s?hu.lex:hu.lexInline)(o,n),l=n.hooks?await n.hooks.processAllTokens(a):a;n.walkTokens&&await Promise.all(this.walkTokens(l,n.walkTokens));let d=await(n.hooks?await n.hooks.provideParser():s?fu.parse:fu.parseInline)(l,n);return n.hooks?await n.hooks.postprocess(d):d})().catch(r);try{n.hooks&&(e=n.hooks.preprocess(e));let o=(n.hooks?n.hooks.provideLexer():s?hu.lex:hu.lexInline)(e,n);n.hooks&&(o=n.hooks.processAllTokens(o)),n.walkTokens&&this.walkTokens(o,n.walkTokens);let a=(n.hooks?n.hooks.provideParser():s?fu.parse:fu.parseInline)(o,n);return n.hooks&&(a=n.hooks.postprocess(a)),a}catch(o){return r(o)}}}onError(s,e){return t=>{if(t.message+=`
|
|
202
202
|
Please report this to https://github.com/markedjs/marked.`,s){let i="<p>An error occurred:</p><pre>"+ph(t.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(t);throw t}}},KC=new uFe;function Gn(s,e){return KC.parse(s,e)}Gn.options=Gn.setOptions=function(s){return KC.setOptions(s),Gn.defaults=KC.defaults,rve(Gn.defaults),Gn};Gn.getDefaults=nee;Gn.defaults=Ny;Gn.use=function(...s){return KC.use(...s),Gn.defaults=KC.defaults,rve(Gn.defaults),Gn};Gn.walkTokens=function(s,e){return KC.walkTokens(s,e)};Gn.parseInline=KC.parseInline;Gn.Parser=fu;Gn.parser=fu.parse;Gn.Renderer=r4;Gn.TextRenderer=uee;Gn.Lexer=hu;Gn.lexer=hu.lex;Gn.Tokenizer=s4;Gn.Hooks=ND;Gn.parse=Gn;Gn.options;Gn.setOptions;Gn.use;Gn.walkTokens;Gn.parseInline;fu.parse;hu.lex;function hFe(s){return{completed:"✅",in_progress:"🔄",pending:"⬜",cancelled:"❌"}[s]||"⬜"}function fFe(s,e){return s?s.length>30?s.slice(0,30)+"...":s:e}function gFe(s,e){try{const t=JSON.parse(e);return s==="bash"||s==="execute_bash"?t.command+(t.workdir?` (${t.workdir})`:""):s==="read_file"?t.file_path+(t.offset?`:${t.offset}`:""):s==="edit_file"||s==="write_file"?t.file_path:s==="glob"||s==="find_files"?t.pattern+(t.directory?` (${t.directory})`:""):s==="grep"||s==="search_content"?`"${t.pattern}" (${t.directory||""})`:e}catch{return e}}function pFe(s){var e;return((e=s==null?void 0:s.function)==null?void 0:e.name)||"unknown_tool"}function mFe(s){var e;return((e=s==null?void 0:s.function)==null?void 0:e.arguments)||""}function hee(s){return s?Gn(s):""}function _Fe(s){return{type:"think",content:s,renderedContent:hee(s)}}function vFe(s){const e=(s==null?void 0:s.thought)||"";return{type:"step",thought:e,renderedThought:hee(e),toolCalls:Array.isArray(s==null?void 0:s.toolCalls)?s.toolCalls.filter(Boolean):[],success:s==null?void 0:s.success}}function bFe(s,e){return!s||typeof s!="object"?{type:"system",content:String(s),_id:`log-${e()}`}:s._id?s:{...s,_id:`log-${e()}`}}function CFe(s){return s?{scrollTop:s.scrollTop,scrollHeight:s.scrollHeight,clientHeight:s.clientHeight}:null}function yFe(s,{force:e=!1,threshold:t=150,prevSnapshot:i=null}={}){if(!s){console.log("[scrollToBottom] container is null/undefined, skip");return}const n=s.scrollHeight-s.scrollTop-s.clientHeight;if(e){s.scrollTop=s.scrollHeight,console.log("[scrollToBottom] force scroll → scrollTop:",s.scrollHeight,"| curDist:",n);return}const r=i?i.scrollHeight-i.scrollTop-i.clientHeight:n;console.log("[scrollToBottom] force: false | scrollTop:",s.scrollTop,"| scrollHeight:",s.scrollHeight,"| clientHeight:",s.clientHeight,"| curDist:",n,"| refDist:",r,"| threshold:",t),r<=t?(s.scrollTop=s.scrollHeight,console.log("[scrollToBottom] SCROLL (refDist <= threshold)")):console.log("[scrollToBottom] SKIP (refDist > threshold, user was away from bottom)")}const wFe={name:"CodeView",components:{SessionsPanel:LAe,FileSelectDialog:jAe,SkillSelectDialog:YAe,ModelSelectDialog:e2e,CommandDialog:r2e,ResizableTextarea:d2e,ImagePreviewList:p2e},MAX_LOG_ITEMS:400,props:{sidebarVisible:{type:Boolean,default:!0}},data(){return{layoutMode:1,focusedPanelIndex:0,sessions:[],displayedSessions:[],currentSession:null,activeSessions:[],page:1,pageSize:10,hasMore:!1,loadingMore:!1,draggedSession:null,fileSelectVisible:!1,skillSelectVisible:!1,skillCursorPos:-1,currentPanel:null,modelSelectVisible:!1,selectedPanel:null,commandDialogVisible:!1,scrollRafMap:new WeakMap,logSeq:0,wsUnsubscribers:[],previewImage:null}},watch:{"$route.params.id":{immediate:!0,handler(s){if(s){const e=this.sessions.find(t=>t.id===s);e&&(this.currentSession=e,this.updateActiveSessions())}}}},created(){this.initGlobalWs(),this.loadSessions()},async mounted(){document.addEventListener("keydown",this.onKeydown)},beforeDestroy(){document.removeEventListener("keydown",this.onKeydown)},activated(){this.activeSessions.forEach(s=>{var e;(e=s.session)!=null&&e.id&&(this.subscribePanel(s),this.schedulePanelScroll(s))})},deactivated(){this.activeSessions.forEach(s=>{s.wsUnsubscribe&&(s.wsUnsubscribe(),s.wsUnsubscribe=null)})},methods:{onInputChange(s,e){const t=s.lastIndexOf("@");t!==-1&&!s.slice(t+1).includes(" ")&&!this.fileSelectVisible&&(this.currentPanel=e,this.fileSelectVisible=!0)},onFileSelected(s){const e=this.currentPanel;if(!e)return;const t=e.input.lastIndexOf("@");e.input=e.input.slice(0,t)+s+" ",this.cancelFileSelect()},cancelFileSelect(){this.fileSelectVisible=!1,this.currentPanel=null},openModelSelector(s){this.selectedPanel=s,this.modelSelectVisible=!0},onModelSelected(s){if(this.selectedPanel){const e=s.name.split("/"),t=e.length>2?e.slice(1).join("/"):s.name;this.selectedPanel.modelName=t,C2e("defaultModel",t)}},openCommandDialog(){this.commandDialogVisible=!0},openFileSelectFromStatus(){this.currentPanel=this.activeSessions[this.focusedPanelIndex],this.fileSelectVisible=!0},openSkillSelectFromStatus(){this.currentPanel=this.activeSessions[this.focusedPanelIndex];const e=this.$el.querySelectorAll(".input-area textarea")[this.focusedPanelIndex];this.skillCursorPos=e?e.selectionStart:-1,this.skillSelectVisible=!0},onSkillSelected(s){const e=this.currentPanel;if(!e)return;const t=`[${s}] `,i=this.skillCursorPos>=0?this.skillCursorPos:0;e.input=e.input.slice(0,i)+t+e.input.slice(i),this.cancelSkillSelect()},cancelSkillSelect(){this.skillSelectVisible=!1,this.currentPanel=null},toggleChatMode(s){s&&(s.chatMode=s.chatMode==="plan"?"code":"plan")},async handleExecuteCommand(s){const e=this.activeSessions[this.focusedPanelIndex];if(!e){this.$message.warning("请先选择面板");return}e.input=s+" ",this.$nextTick(()=>{var i;const t=(i=e.$el)==null?void 0:i.querySelector(".input-area textarea");t&&t.focus()})},getTodoStatusIcon:hFe,getTitleText:fFe,formatInput:gFe,getToolCallName:pFe,getToolCallArguments:mFe,renderMarkdown:hee,createThinkItem:_Fe,createStepItem:vFe,withLogId(s){return bFe(s,()=>++this.logSeq)},pushLogItem(s,e){s.logItems.push(this.withLogId(e));const t=this.$options.MAX_LOG_ITEMS||400;s.logItems.length>t&&s.logItems.splice(0,s.logItems.length-t)},stopThinking(s){s.disabled=!1,s.stopping=!1,s.sessionStatus="idle",clearInterval(s.dotInterval),s.dotInterval=null,s.dotIndex=0},schedulePanelScroll(s,e=null){if(this.scrollRafMap.get(s))return;const t=requestAnimationFrame(()=>{var n,r;this.scrollRafMap.delete(s);const i=this.activeSessions.indexOf(s);if(i>-1){const o=(r=(n=this.$el)==null?void 0:n.querySelectorAll(".session-panel"))==null?void 0:r[i],a=o==null?void 0:o.querySelector(".log-area");yFe(a,{prevSnapshot:e})}});this.scrollRafMap.set(s,t)},snapPanelScroll(s){var t,i;const e=this.activeSessions.indexOf(s);if(e>-1){const n=(i=(t=this.$el)==null?void 0:t.querySelectorAll(".session-panel"))==null?void 0:i[e],r=n==null?void 0:n.querySelector(".log-area");return CFe(r)}return null},initGlobalWs(){Cd.init()},subscribePanel(s){var e;(e=s.session)!=null&&e.id&&(s.wsUnsubscribe&&s.wsUnsubscribe(),s.wsUnsubscribe=Cd.subscribe(s.session.id,{running_sessions:t=>{const i=(t==null?void 0:t.runningSessionIds)||[];this.updateSessionStatusesFromRunning(i)},todos:t=>{const i=this.snapPanelScroll(s);this.pushLogItem(s,{type:"todos",todos:t.todos}),this.$nextTick(()=>this.schedulePanelScroll(s,i))},session:t=>{var i;t!=null&&t.sessionId&&!((i=s.session)!=null&&i.id)&&(s.session={...s.session,id:t.sessionId})},step:t=>{var n;const i=this.snapPanelScroll(s);this.pushLogItem(s,this.createStepItem(t)),(n=t==null?void 0:t.usage)!=null&&n.promptTokens&&(s.promptTokens=t.usage.promptTokens),this.$nextTick(()=>this.schedulePanelScroll(s,i))},compact:t=>{this.pushLogItem(s,{type:"system",content:`【压缩完成】${t.summary||""}`}),this.loadSessions(),this.loadMessagesForPanel(s,s.session.id)},done:t=>{var i,n;if(!(t!=null&&t.sessionId&&((i=s.session)!=null&&i.id)&&t.sessionId!==s.session.id)){if(this.stopThinking(s),s.sessionStatus="completed",t!=null&&t.modelName&&(s.modelName=t.modelName),(n=t==null?void 0:t.usage)!=null&&n.promptTokens&&(s.promptTokens=t.usage.promptTokens),t!=null&&t.response){const r=this.snapPanelScroll(s);this.pushLogItem(s,this.createThinkItem(t.response)),this.$nextTick(()=>this.schedulePanelScroll(s,r))}this.loadSessions()}},stopped:t=>{this.stopThinking(s),s.sessionStatus="idle";const i=this.snapPanelScroll(s);this.pushLogItem(s,this.createThinkItem("【已停止】")),this.$nextTick(()=>this.schedulePanelScroll(s,i))},error:t=>{this.$message.error((t==null?void 0:t.error)||"发生错误"),this.stopThinking(s),s.sessionStatus="idle"}}))},setLayout(s){this.layoutMode=s,this.updateActiveSessions()},updateActiveSessions(){const s=this.layoutMode,e=[];for(let t=0;t<s;t++)e.push(this.activeSessions[t]||{session:null,logItems:[],userQuestion:"",modelName:"",input:"",disabled:!1,stopping:!1,wsConnected:!1,promptTokens:0,dotInterval:null,compactionRatio:0,sessionStatus:"idle",enableDevLog:!1,chatMode:"code",mediaFiles:[]});this.activeSessions=e},updateSessionStatusesFromRunning(s){var t;const e=new Set(s||[]);for(const i of this.sessions){const n=e.has(i.id);i.status=n?"processing":"idle"}for(const i of this.activeSessions)if((t=i.session)!=null&&t.id){const n=e.has(i.session.id);i.sessionStatus=n?"processing":"idle",i.disabled=n}},onDragStart(s,e){this.draggedSession=e,s.dataTransfer.effectAllowed="move"},onDropPanel(s,e){if(!this.draggedSession)return;const t=this.activeSessions[e];t.session=this.draggedSession,t.logItems=[],t.userQuestion="",t.disabled=!1,t.stopping=!1,t.promptTokens=0,t.chatMode="code",t.mediaFiles=[],t.sessionStatus=this.draggedSession.status||"idle",t.sessionStatus==="processing"&&(t.disabled=!0),this.loadMessagesForPanel(t,this.draggedSession.id),this.subscribePanel(t),this.draggedSession=null},bindSessionToPanel(s,e=null){const t=e!==null?e:this.focusedPanelIndex;if(t>=0&&t<this.activeSessions.length){const i=this.activeSessions[t],n=s.status==="processing";Object.assign(i,{session:s,logItems:[],userQuestion:"",disabled:n,stopping:!1,promptTokens:0,compactionRatio:0,sessionStatus:s.status||"idle",chatMode:"code",mediaFiles:[]}),this.loadMessagesForPanel(i,s.id),this.subscribePanel(i)}},async loadMessagesForPanel(s,e){try{const t=await sve(e);s.logItems=(t.data||[]).map(r=>r.type==="think"?this.withLogId(this.createThinkItem(r.content||"")):r.type==="step"?this.withLogId(this.createStepItem(r)):r.type==="chat"&&r.mediaFiles?this.withLogId({type:"chat",content:r.content,mediaFiles:r.mediaFiles}):this.withLogId(r));const i=s.logItems.find(r=>r.type==="chat"||r.type==="think");i&&(s.userQuestion=i.content);const n=this.sessions.find(r=>r.id===e);n&&(s.sessionStatus=n.status||"idle")}catch{s.logItems=[]}},async loadSessions(){try{const s=await ive(this.pageSize,(this.page-1)*this.pageSize);this.sessions=s.data||[],this.displayedSessions=this.sessions.slice(0,this.pageSize),this.hasMore=this.sessions.length>this.pageSize,this.updateActiveSessions()}catch(s){console.error("加载会话失败:",s)}},handleKeydown(s,e){if(s.key==="Enter")if(s.ctrlKey){const t=s.target,i=t.selectionStart,n=t.selectionEnd,r=e.input;e.input=r.substring(0,i)+`
|
|
203
|
-
`+r.substring(n),this.$nextTick(()=>{t.selectionStart=t.selectionEnd=i+1})}else s.preventDefault(),this.sendToPanel(e)},loadMore(){this.loadingMore=!0,this.page++;const s=this.sessions.slice(0,this.page*this.pageSize);this.displayedSessions=s,this.hasMore=this.sessions.length>s.length,this.loadingMore=!1},async createSession(){try{const s=await nve("新会话");this.sessions.unshift(s.data),this.page=1,this.displayedSessions=this.sessions.slice(0,this.pageSize),this.hasMore=this.sessions.length>this.pageSize,this.bindSessionToPanel(s.data)}catch(s){this.$message.error("创建会话失败: "+s.message)}},selectSession(s){this.currentSession=s,this.$route.params.id!==s.id&&this.$router.push({name:"codeView-session",params:{id:s.id}}).catch(()=>{}),this.bindSessionToPanel(s),this.loadDefaultModel(s)},async loadDefaultModel(s){var e,t;try{const i=await b2e("defaultModel");if((e=i.data)!=null&&e.value){const n=this.activeSessions[this.focusedPanelIndex];n&&((t=n.session)==null?void 0:t.id)===s.id&&(n.modelName=i.data.value)}}catch(i){console.error("加载默认模型失败:",i)}},async sendToPanel(s){const e=s.input.trim();if(!e||s.disabled)return;const t=S2e(s);s.input="",s.disabled=!0,s.stopping=!1,s.userQuestion=e;const i=this.snapPanelScroll(s),n=(s.mediaFiles||[]).filter(r=>!r.uploading&&r.filePath);this.pushLogItem(s,{type:"chat",content:t.message,mediaFiles:n.map(r=>({filePath:r.filePath,type:r.type,dataUrl:r.dataUrl}))}),this.$nextTick(()=>this.schedulePanelScroll(s,i)),Cd.send("chat",t),s.mediaFiles=[]},async _uploadFiles(s,e){console.log("[_uploadFiles] files:",s.length,"panel.mediaFiles count:",(e.mediaFiles||[]).length);const n=5-(e.mediaFiles||[]).length;if(n<=0){this.$message.warning("最多上传5张图片");return}const r=Math.min(s.length,n);e.mediaFiles||(e.mediaFiles=[]);for(let o=0;o<r;o++){const a=s[o],l=Date.now()+"_"+o+"_"+Math.random().toString(36).slice(2);e.mediaFiles.push({id:l,name:a.name||"paste.png",dataUrl:"",filePath:"",type:a.type||"image/png",uploading:!0})}for(let o=0;o<r;o++){const a=s[o],l=e.mediaFiles.length-r+o;try{const d=await x2e(a);e.mediaFiles[l].dataUrl=d.dataUrl,e.mediaFiles[l].filePath=d.filePath,e.mediaFiles[l].type=d.type,e.mediaFiles[l].uploading=!1}catch(d){this.$message.error("图片上传失败: "+d.message),e.mediaFiles.splice(l,1)}}},handleImageUpload(s){var n;console.log("[handleImageUpload] idx:",s,"activeSessions:",this.activeSessions.length);const e=this.activeSessions[s];if(!e){console.log("[handleImageUpload] panel is null/undefined");return}if(e.disabled){console.log("[handleImageUpload] panel.disabled=true");return}const t="imgInput-"+s,i=this.$refs[t];console.log("[handleImageUpload] refKey:",t,"inputEl:",i,"isArray:",Array.isArray(i)),i?Array.isArray(i)?(console.log("[handleImageUpload] clicking inputEl[0]"),(n=i[0])==null||n.click()):(console.log("[handleImageUpload] clicking inputEl directly"),i.click()):console.log("[handleImageUpload] inputEl not found! available refs:",Object.keys(this.$refs).filter(r=>r.startsWith("imgInput")))},async handleImageSelected(s,e){var n;console.log("[handleImageSelected] triggered, event.target.files length:",(n=s.target.files)==null?void 0:n.length);const t=s.target.files;if(!t||t.length===0){console.log("[handleImageSelected] no files selected");return}const i=Array.from(t);s.target.value="",console.log("[handleImageSelected] uploading",i.length,"files"),await this._uploadFiles(i,e)},async handlePasteImages(s,e){!e||e.disabled||await this._uploadFiles(s,e)},removeMedia(s,e){if(!s||!s.mediaFiles)return;const t=s.mediaFiles.findIndex(i=>i.id===e);t>-1&&s.mediaFiles.splice(t,1)},openImagePreview(s){this.previewImage=s},closeImagePreview(){this.previewImage=null},onKeydown(s){s.key==="Escape"&&this.previewImage&&this.closeImagePreview()},stopPanel(s){var e;!((e=s.session)!=null&&e.id)||s.stopping||(s.stopping=!0,Cd.send("stop",{sessionId:s.session.id}))},async handleSessionCommand(s,e){s==="rename"?this.$prompt("请输入新名称","重命名会话",{confirmButtonText:"确定",cancelButtonText:"取消",inputValue:e.title||"新会话",inputPattern:/.+/,inputErrorMessage:"名称不能为空"}).then(async({value:t})=>{var i;try{await _2e(e.id,{title:t}),e.title=t,((i=this.currentSession)==null?void 0:i.id)===e.id&&(this.currentSession.title=t),this.$message.success("重命名成功")}catch(n){this.$message.error("重命名失败: "+n.message)}}).catch(()=>{}):s==="delete"&&this.$confirm("确定要删除该会话吗?此操作会同时删除会话中的所有消息。","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(async()=>{var t;try{await v2e(e.id);const i=this.sessions.findIndex(r=>r.id===e.id);i>-1&&this.sessions.splice(i,1);const n=this.displayedSessions.findIndex(r=>r.id===e.id);n>-1&&this.displayedSessions.splice(n,1),((t=this.currentSession)==null?void 0:t.id)===e.id&&(this.currentSession=this.displayedSessions.length>0?this.displayedSessions[0]:null),this.$message.success("删除成功")}catch(i){this.$message.error("删除失败: "+i.message)}}).catch(()=>{})}}};var SFe=function(){var i,n;var e=this,t=e._self._c;return t("div",{staticClass:"code-view"},[e.sidebarVisible?t("SessionsPanel",{attrs:{sessions:e.displayedSessions,"current-session-id":(i=e.currentSession)==null?void 0:i.id,"has-more":e.hasMore,"loading-more":e.loadingMore},on:{create:e.createSession,select:e.selectSession,command:e.handleSessionCommand,dragstart:e.onDragStart,loadmore:e.loadMore}}):e._e(),t("div",{staticClass:"terminal-container",class:"layout-"+e.layoutMode},e._l(e.activeSessions,function(r,o){var a,l,d,h,f,p;return t("div",{key:o,staticClass:"session-panel",class:{"panel-active":e.focusedPanelIndex===o},on:{click:function(m){e.focusedPanelIndex=o},dragover:function(m){m.preventDefault()},drop:function(m){return e.onDropPanel(m,o)}}},[t("div",{staticClass:"panel-header"},[t("span",{staticClass:"title"},[e._v("# "+e._s((a=r.session)!=null&&a.id?e.getTitleText(r.userQuestion,"新会话"):"选择会话"))])]),t("div",{staticClass:"log-area"},[(l=r.session)!=null&&l.id?[e._l(r.logItems,function(m,v){return[m.type==="todos"?t("div",{staticClass:"todos-list"},e._l(m.todos,function(b,y){return t("div",{key:`${m._id||v}-todo-${y}`,staticClass:"todo-item"},[t("span",{staticClass:"todo-status"},[e._v(e._s(e.getTodoStatusIcon(b.status)))]),t("span",{staticClass:"todo-name"},[e._v(e._s(b.name))])])}),0):m.type==="chat"?t("div",{staticClass:"flex justify-end"},[t("div",{staticClass:"user-question"},[m.mediaFiles&&m.mediaFiles.length>0?t("div",{staticClass:"chat-images"},e._l(m.mediaFiles,function(b){return t("img",{key:b.filePath,staticClass:"chat-image-thumb",attrs:{src:b.url||b.dataUrl||b.filePath},on:{click:function(y){return y.stopPropagation(),e.openImagePreview(b)}}})}),0):e._e(),t("div",[e._v(e._s(m.content))])])]):m.type==="think"?t("p",{domProps:{innerHTML:e._s(m.renderedContent||e.renderMarkdown(m.content))}}):m.type==="step"?[m.thought?t("p",{domProps:{innerHTML:e._s(m.renderedThought||e.renderMarkdown(m.thought))}}):e._e(),e._l(m.toolCalls,function(b,y){return t("div",{key:`${m._id||v}-tool-${y}`,staticClass:"log-mute"},[t("span",{class:m.success!==!1?"tool-success":"tool-fail"},[e._v(" "+e._s(m.success!==!1?"✓":"✗")+" ")]),e._v(" "+e._s(e.getToolCallName(b))+" "),e.getToolCallArguments(b)?t("span",{staticClass:"tool-input"},[e._v(e._s(e.formatInput(e.getToolCallName(b),e.getToolCallArguments(b))))]):e._e()])})]:e._e()]}),r.logItems.length===0?t("div",{staticClass:"empty-state"},[t("span",[e._v("开始对话吧!输入您的问题...")])]):e._e(),r.modelName?t("div",{staticClass:"build-info"},[t("span",{staticClass:"icon"},[e._v("▣")]),e._v(" Build · "+e._s(r.modelName)+" ")]):e._e()]:t("div",{staticClass:"empty-state"},[t("span",[e._v("拖拽会话到此处或点击选择")])])],2),t("div",{staticClass:"input-block"},[r.mediaFiles&&r.mediaFiles.length>0?t("ImagePreviewList",{attrs:{files:r.mediaFiles,disabled:r.disabled},on:{remove:m=>e.removeMedia(r,m)}}):e._e(),t("div",{staticClass:"input-wrapper"},[t("ResizableTextarea",{staticClass:"input-area",attrs:{rows:5,placeholder:"输入消息... (Enter 发送, Ctrl+Enter 换行, @ 选择文件)",disabled:r.disabled||!((d=r.session)!=null&&d.id)},on:{input:function(m){return e.onInputChange(m,r)},"paste-image":function(m){return e.handlePasteImages(m,r)}},nativeOn:{keydown:[function(m){return!m.type.indexOf("key")&&e._k(m.keyCode,"enter",13,m.key,"Enter")?null:e.handleKeydown(m,r)},function(m){return!m.type.indexOf("key")&&e._k(m.keyCode,"esc",27,m.key,["Esc","Escape"])?null:e.cancelFileSelect.apply(null,arguments)}]},model:{value:r.input,callback:function(m){e.$set(r,"input",m)},expression:"panel.input"}}),t("input",{ref:"imgInput-"+o,refInFor:!0,staticStyle:{display:"none"},attrs:{type:"file",accept:"image/*",multiple:""},on:{change:m=>e.handleImageSelected(m,r)}}),t("div",{staticClass:"input-actions"},[t("el-button",{staticClass:"upload-btn",attrs:{disabled:r.disabled||!((h=r.session)!=null&&h.id),size:"small"},on:{click:function(m){return e.handleImageUpload(o)}}},[e._v(" 图片 ")]),r.disabled&&!r.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"danger",size:"small"},on:{click:function(m){return m.stopPropagation(),e.stopPanel(r)}}},[e._v(" ■ 停止 ")]):r.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"info",disabled:"",size:"small"}},[e._v(" 停止中... ")]):t("el-button",{staticClass:"send-btn",attrs:{type:"primary",disabled:!((f=r.session)!=null&&f.id),size:"small"},on:{click:function(m){return m.stopPropagation(),e.sendToPanel(r)}}},[e._v(" 发送 ")])],1)],1)],1),t("div",{staticClass:"status-bar"},[r.sessionStatus==="processing"||r.disabled&&!r.stopping?t("span",{staticClass:"status-thinking"},[t("span",{staticClass:"thinking-spinner",attrs:{"aria-hidden":"true"}}),e._v(" 思考中 ")]):t("span",{staticClass:"status-ready"},[e._v("✓ 就绪")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"model-selector",on:{click:function(m){return m.stopPropagation(),e.openModelSelector(r)}}},[e._v(" 模型:"+e._s(r.modelName||"-")+" ▾ ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("会话:"+e._s((p=r.session)!=null&&p.id?r.session.id.slice(0,8):"--------"))]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("token:("),t("span",{class:r.promptTokens>5e4?"token-warning":""},[e._v(e._s(r.promptTokens||0)+e._s(r.promptTokens>5e4?" 会话太大推荐用/compact压缩会话":""))]),e._v(")")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:function(m){return m.stopPropagation(),e.openCommandDialog.apply(null,arguments)}}},[e._v("命令")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:function(m){return m.stopPropagation(),e.openFileSelectFromStatus.apply(null,arguments)}}},[e._v("选择文件")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:function(m){return m.stopPropagation(),e.openSkillSelectFromStatus.apply(null,arguments)}}},[e._v("选择Skill")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:function(m){return m.stopPropagation(),e.toggleChatMode(r)}}},[e._v(" 模式:"+e._s(r.chatMode==="plan"?"计划":"编码")+" ▾ ")])])])}),0),t("div",{staticClass:"layout-switcher"},[t("el-button-group",[t("el-button",{attrs:{type:e.layoutMode===1?"primary":""},on:{click:function(r){return e.setLayout(1)}}},[e._v("1")]),t("el-button",{attrs:{type:e.layoutMode===2?"primary":""},on:{click:function(r){return e.setLayout(2)}}},[e._v("2")]),t("el-button",{attrs:{type:e.layoutMode===4?"primary":""},on:{click:function(r){return e.setLayout(4)}}},[e._v("4")])],1)],1),t("FileSelectDialog",{attrs:{visible:e.fileSelectVisible},on:{"update:visible":function(r){e.fileSelectVisible=r},select:e.onFileSelected,close:e.cancelFileSelect}}),t("SkillSelectDialog",{attrs:{visible:e.skillSelectVisible},on:{"update:visible":function(r){e.skillSelectVisible=r},select:e.onSkillSelected,close:e.cancelSkillSelect}}),t("ModelSelectDialog",{attrs:{visible:e.modelSelectVisible,"current-model":(n=e.selectedPanel)==null?void 0:n.modelName},on:{"update:visible":function(r){e.modelSelectVisible=r},select:e.onModelSelected,close:function(r){e.modelSelectVisible=!1}}}),t("CommandDialog",{attrs:{visible:e.commandDialogVisible},on:{"update:visible":function(r){e.commandDialogVisible=r},execute:e.handleExecuteCommand,close:function(r){e.commandDialogVisible=!1}}}),e.previewImage?t("div",{staticClass:"image-lightbox",on:{click:e.closeImagePreview}},[t("span",{staticClass:"lightbox-close",on:{click:e.closeImagePreview}},[e._v("×")]),t("img",{staticClass:"lightbox-image",attrs:{src:e.previewImage.url||e.previewImage.dataUrl||e.previewImage.filePath},on:{click:function(r){r.stopPropagation()}}})]):e._e()],1)},xFe=[],kFe=en(wFe,SFe,xFe,!1,null,"fef60548");const rce=kFe.exports,LFe={name:"ProviderList",props:{providers:{type:Array,default:()=>[]},models:{type:Array,default:()=>[]},songbingProvider:{type:Object,default:null}},emits:["add-provider","edit-provider","delete-provider","add-model","edit-model","delete-model","export-config","import-config","auth-songbing","sync-songbing-models","cancel-songbing-auth"],data(){return{expandedProviders:[]}},computed:{nonOfficialProviders(){return this.providers.filter(s=>s.name!=="自建AI平台")},songbingModels(){return this.songbingProvider?this.models.filter(s=>s.providerId===this.songbingProvider.id):[]},songbingBaseUrl(){var s;return((s=this.songbingProvider)==null?void 0:s.baseUrl)||""},songbingPlatformUrl(){return this.songbingBaseUrl.replace(/\/api\/v1$/,"")}},methods:{toggleProvider(s){const e=this.expandedProviders.indexOf(s);e>-1?this.expandedProviders.splice(e,1):this.expandedProviders.push(s)},getModelsByProvider(s){return this.models.filter(e=>e.providerId===s)}}};var DFe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"provider-list"},[t("div",{staticClass:"flex justify-between items-center mb-4"},[t("h3",{staticClass:"text-xl text-white"},[e._v("AI 服务商 & 模型")]),t("div",{staticClass:"flex gap-2"},[t("el-button",{attrs:{size:"small"},on:{click:function(i){return e.$emit("export-config")}}},[t("i",{staticClass:"fa-solid fa-download mr-1"}),e._v("导出配置 ")]),t("el-button",{attrs:{size:"small"},on:{click:function(i){return e.$emit("import-config")}}},[t("i",{staticClass:"fa-solid fa-upload mr-1"}),e._v("导入配置 ")]),t("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(i){return e.$emit("add-provider")}}},[e._v("+ 添加服务商")])],1)]),t("div",{staticClass:"providers"},[t("div",{staticClass:"provider-item official-provider"},[t("div",{staticClass:"provider-main",on:{click:function(i){return e.toggleProvider("songbing-official")}}},[t("span",{staticClass:"expand-icon",class:{expanded:e.expandedProviders.includes("songbing-official")}},[e._v("▶")]),t("div",{staticClass:"provider-logo official-logo"},[e._v("S")]),t("div",{staticClass:"provider-info"},[t("div",{staticClass:"provider-name"},[e._v(" 自建AI平台 "),e.songbingProvider?t("el-tag",{attrs:{type:"success",size:"mini"}},[e._v("已认证")]):e._e()],1),t("div",{staticClass:"provider-url"},[e._v(e._s(e.songbingPlatformUrl))])]),t("div",{staticClass:"provider-actions"},[t("el-button",{attrs:{type:"warning",size:"small"},on:{click:function(i){return i.stopPropagation(),e.$emit("auth-songbing")}}},[e._v(" "+e._s(e.songbingProvider?"重新认证":"认证")+" ")]),t("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(i){return i.stopPropagation(),e.$emit("sync-songbing-models")}}},[e._v(" 同步模型 ")]),e.songbingProvider?t("el-button",{attrs:{type:"danger",size:"small"},on:{click:function(i){return i.stopPropagation(),e.$emit("cancel-songbing-auth")}}},[e._v(" 取消认证 ")]):e._e()],1)]),t("div",{staticClass:"models-panel",class:{expanded:e.expandedProviders.includes("songbing-official")}},[e._l(e.songbingModels,function(i){return t("div",{key:i.id,staticClass:"model-item"},[t("span",{staticClass:"model-name"},[e._v(e._s(i.name))]),i.enabled?t("el-tag",{attrs:{type:"success",size:"mini"}},[e._v("启用")]):t("el-tag",{attrs:{type:"info",size:"mini"}},[e._v("禁用")])],1)}),e.songbingModels.length===0?t("div",{staticClass:"empty-models"},[e._v(" 暂无模型,请先认证后同步 ")]):e._e()],2)]),e._l(e.nonOfficialProviders,function(i){return t("div",{key:i.id,staticClass:"provider-item"},[t("div",{staticClass:"provider-main",on:{click:function(n){return e.toggleProvider(i.id)}}},[t("span",{staticClass:"expand-icon",class:{expanded:e.expandedProviders.includes(i.id)}},[e._v("▶")]),t("div",{staticClass:"provider-logo"},[e._v(e._s(i.name.charAt(0).toUpperCase()))]),t("div",{staticClass:"provider-info"},[t("div",{staticClass:"provider-name"},[e._v(" "+e._s(i.name)+" "),i.isDefault?t("el-tag",{attrs:{type:"success",size:"mini"}},[e._v("默认")]):e._e()],1),t("div",{staticClass:"provider-url"},[e._v(e._s(i.baseUrl))])]),t("div",{staticClass:"provider-actions"},[t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(n){return n.stopPropagation(),e.$emit("edit-provider",i)}}},[e._v("修改")]),t("el-button",{staticClass:"delete-btn",attrs:{type:"text",size:"small"},on:{click:function(n){return n.stopPropagation(),e.$emit("delete-provider",i.id)}}},[e._v("删除")])],1)]),t("div",{staticClass:"models-panel",class:{expanded:e.expandedProviders.includes(i.id)}},[t("div",{staticClass:"models-header"},[t("span",{staticClass:"models-title"},[e._v("模型列表")]),t("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(n){return n.stopPropagation(),e.$emit("add-model",i.id)}}},[e._v("+ 添加模型")])],1),e._l(e.getModelsByProvider(i.id),function(n){return t("div",{key:n.id,staticClass:"model-item"},[t("span",{staticClass:"model-name"},[e._v(e._s(n.name))]),n.enabled?t("el-tag",{attrs:{type:"success",size:"mini"}},[e._v("启用")]):t("el-tag",{attrs:{type:"info",size:"mini"}},[e._v("禁用")]),t("div",{staticClass:"model-actions"},[t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(r){return r.stopPropagation(),e.$emit("edit-model",n)}}},[e._v("修改")]),t("el-button",{staticClass:"delete-btn",attrs:{type:"text",size:"small"},on:{click:function(r){return r.stopPropagation(),e.$emit("delete-model",n.id)}}},[e._v("删除")])],1)],1)}),e.getModelsByProvider(i.id).length===0?t("div",{staticClass:"empty-models"},[e._v(" 暂无模型 ")]):e._e()],2)])}),e.nonOfficialProviders.length===0?t("div",{staticClass:"empty"},[e._v(" 暂无服务商 ")]):e._e()],2)])},IFe=[],EFe=en(LFe,DFe,IFe,!1,null,"82828189");const TFe=EFe.exports,NFe={name:"ProviderDialog",props:{visible:{type:Boolean,default:!1},editingProvider:{type:Object,default:null}},data(){return{selectedPreset:"",originalApiKey:"",presets:[{name:"openai",label:"OpenAI",nameValue:"OpenAI",baseUrlValue:"https://api.openai.com/v1"},{name:"deepseek",label:"DeepSeek",nameValue:"DeepSeek",baseUrlValue:"https://api.deepseek.com/v1"},{name:"minimax",label:"MiniMax",nameValue:"MiniMax",baseUrlValue:"https://api.minimax.io/v1"},{name:"zlm",label:"ZLM",nameValue:"ZLM",baseUrlValue:"https://open.bigmodel.cn/api/paas/v4/"},{name:"qwen",label:"Qwen",nameValue:"Qwen",baseUrlValue:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1"},{name:"xiaomi_mimo",label:"Xiaomi Mimo",nameValue:"Xiaomi Mimo",baseUrlValue:"https://api.xiaomimimo.com/v1"},{name:"openrouter",label:"OpenRouter",nameValue:"OpenRouter",baseUrlValue:"https://openrouter.ai/api/v1"},{name:"custom",label:"自定义",nameValue:"",baseUrlValue:""}],form:{name:"",apiKey:"",baseUrl:""},rules:{name:[{required:!0,message:"请输入名称",trigger:"blur"}],apiKey:[{required:!0,message:"请输入 API Key",trigger:"blur"}]}}},watch:{visible(s){s&&this.editingProvider?this.loadProviderDetail():s&&(this.selectedPreset="",this.originalApiKey="",this.form={name:"",apiKey:"",baseUrl:""})}},methods:{async loadProviderDetail(){var s;try{const e=await this.$api.getProvider(this.editingProvider.id);this.originalApiKey=((s=e.data)==null?void 0:s.apiKey)||"",this.form={name:this.editingProvider.name,apiKey:this.originalApiKey,baseUrl:this.editingProvider.baseUrl||""}}catch{this.form={name:this.editingProvider.name,apiKey:"",baseUrl:this.editingProvider.baseUrl||""}}},onPresetChange(s){const e=this.presets.find(t=>t.name===s);e&&(this.form.name=e.nameValue,this.form.baseUrl=e.baseUrlValue)},handleClose(){var s;(s=this.$refs.formRef)==null||s.resetFields(),this.selectedPreset="",this.originalApiKey="",this.$emit("update:visible",!1),this.$emit("close")},async handleSubmit(){try{await this.$refs.formRef.validate()}catch{return}try{if(this.editingProvider){const s={name:this.form.name,baseUrl:this.form.baseUrl};this.form.apiKey&&this.form.apiKey!==this.originalApiKey&&(s.apiKey=this.form.apiKey),await this.$api.updateProvider(this.editingProvider.id,s),this.$message.success("更新成功")}else await this.$api.addProvider(this.form),this.$message.success("添加成功");this.$emit("success"),this.handleClose()}catch(s){this.$message.error("保存失败: "+s.message)}}}};var MFe=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.editingProvider?"编辑服务商":"添加服务商",visible:e.visible,width:"500px"},on:{"update:visible":function(i){e.visible=i},close:e.handleClose}},[t("el-form",{ref:"formRef",attrs:{model:e.form,rules:e.rules,"label-width":"100px"}},[e.editingProvider?e._e():t("el-form-item",{attrs:{label:"预设模板"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"选择预设或自定义"},on:{change:e.onPresetChange},model:{value:e.selectedPreset,callback:function(i){e.selectedPreset=i},expression:"selectedPreset"}},e._l(e.presets,function(i){return t("el-option",{key:i.name,attrs:{label:i.label,value:i.name}})}),1)],1),t("el-form-item",{attrs:{label:"名称",prop:"name"}},[t("el-input",{attrs:{placeholder:"例如: OpenAI"},model:{value:e.form.name,callback:function(i){e.$set(e.form,"name",i)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"API Key",prop:"apiKey"}},[t("el-input",{attrs:{placeholder:e.editingProvider?"留空则不修改":"sk-..."},model:{value:e.form.apiKey,callback:function(i){e.$set(e.form,"apiKey",i)},expression:"form.apiKey"}}),e.editingProvider&&e.originalApiKey?t("div",{staticClass:"form-tip"},[e._v("当前已设置 API Key")]):e._e()],1),t("el-form-item",{attrs:{label:"Base URL",prop:"baseUrl"}},[t("el-input",{attrs:{placeholder:"https://api.openai.com/v1"},model:{value:e.form.baseUrl,callback:function(i){e.$set(e.form,"baseUrl",i)},expression:"form.baseUrl"}})],1)],1),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.handleClose}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleSubmit}},[e._v("保存")])],1)],1)},RFe=[],PFe=en(NFe,MFe,RFe,!1,null,"d50706a6");const OFe=PFe.exports,AFe={name:"ModelDialog",props:{visible:{type:Boolean,default:!1},editingModel:{type:Object,default:null},providers:{type:Array,default:()=>[]},defaultProviderId:{type:String,default:""}},data(){return{form:{providerId:"",name:"",enabled:!0},rules:{providerId:[{required:!0,message:"请选择服务商",trigger:"blur"}],name:[{required:!0,message:"请输入模型名称",trigger:"blur"}]}}},watch:{visible(s){s&&(this.editingModel?this.form={providerId:this.editingModel.providerId,name:this.editingModel.name,enabled:this.editingModel.enabled}:this.form={providerId:this.defaultProviderId||"",name:"",enabled:!0})}},methods:{handleClose(){var s;(s=this.$refs.formRef)==null||s.resetFields(),this.$emit("update:visible",!1),this.$emit("close")},async handleSubmit(){try{await this.$refs.formRef.validate()}catch{return}try{this.editingModel?(await this.$api.updateModel(this.editingModel.id,{name:this.form.name,enabled:this.form.enabled}),this.$message.success("更新成功")):(await this.$api.addModel(this.form),this.$message.success("添加成功")),this.$emit("success"),this.handleClose()}catch(s){this.$message.error("保存失败: "+s.message)}}}};var FFe=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.editingModel?"编辑模型":"添加模型",visible:e.visible,width:"500px"},on:{"update:visible":function(i){e.visible=i},close:e.handleClose}},[t("el-form",{ref:"formRef",attrs:{model:e.form,rules:e.rules,"label-width":"100px"}},[e.editingModel?e._e():t("el-form-item",{attrs:{label:"所属服务商",prop:"providerId"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"选择服务商"},model:{value:e.form.providerId,callback:function(i){e.$set(e.form,"providerId",i)},expression:"form.providerId"}},e._l(e.providers,function(i){return t("el-option",{key:i.id,attrs:{label:i.name,value:i.id}})}),1)],1),t("el-form-item",{attrs:{label:"模型名称",prop:"name"}},[t("el-input",{attrs:{placeholder:"例如: GPT-4"},model:{value:e.form.name,callback:function(i){e.$set(e.form,"name",i)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"启用"}},[t("el-switch",{model:{value:e.form.enabled,callback:function(i){e.$set(e.form,"enabled",i)},expression:"form.enabled"}})],1)],1),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.handleClose}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleSubmit}},[e._v("保存")])],1)],1)},BFe=[],WFe=en(AFe,FFe,BFe,!1,null,"f546052d");const VFe=WFe.exports,HFe={name:"SkillsList",props:{skills:{type:Array,default:()=>[]}}};var $Fe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"skills-list"},[t("div",{staticClass:"list"},[e._l(e.skills,function(i){return t("div",{key:i.id||i.name,staticClass:"skill-item"},[t("div",{staticClass:"skill-info"},[t("div",{staticClass:"skill-name"},[e._v(e._s(i.name))]),t("div",{staticClass:"skill-desc"},[e._v(e._s(i.description||"暂无描述"))])]),t("el-tag",{attrs:{type:i.enabled?"success":"info",size:"mini"}},[e._v(" "+e._s(i.enabled?"启用":"禁用")+" ")])],1)}),e.skills.length===0?t("div",{staticClass:"empty"},[e._v(" 暂无技能 ")]):e._e()],2)])},zFe=[],jFe=en(HFe,$Fe,zFe,!1,null,"fe9ddd0f");const UFe=jFe.exports,qFe={name:"Settings",components:{ProviderList:TFe,ProviderDialog:OFe,ModelDialog:VFe,SkillsList:UFe},data(){return{activeTab:"providers",tabs:[{name:"providers",label:"AI 服务商",icon:"fa-solid fa-server"},{name:"advanced",label:"高级",icon:"fa-solid fa-gear"},{name:"proxy",label:"代理设置",icon:"fa-solid fa-globe"},{name:"gateway",label:"网关",icon:"fa-solid fa-plug"},{name:"email",label:"邮件配置",icon:"fa-solid fa-envelope"}],providers:[],models:[],skills:[],defaultProviderId:null,config:{maxToolIterations:10,maxSessionCompression:5,webPort:4e4},proxyConfig:{enabled:!1,type:"http",host:"",port:1080},gateway:{enabled:!1,clientId:"",clientSecret:""},gatewayStatus:{running:!1,configured:!1},gatewayLoading:!1,showProviderDialog:!1,editingProvider:null,showModelDialog:!1,editingModel:null,emailConfig:{host:"",port:587,secure:!1,user:"",password:"",fromName:""},emailStatus:{valid:null},emailLoading:!1,wafGateway:{serverIp:"",secretKey:""},wafStatus:{status:"stopped",configured:!1},wafGatewayLoading:!1,songbingConfig:{platformUrl:"",apiBaseUrl:""},songbingProvider:null,pollTimer:null,showAuthDialog:!1,authForm:{platformUrl:""},authLoading:!1}},created(){this.loadProviders(),this.loadModels(),this.loadSkills(),this.loadConfig(),this.loadProxyConfig(),this.loadGatewayConfig(),this.loadGatewayStatus(),this.loadSongbingConfig()},activated(){this.activeTab==="gateway"&&(this.loadGatewayConfig(),this.loadGatewayStatus())},watch:{activeTab(s){s==="gateway"?(this.loadGatewayConfig(),this.loadGatewayStatus(),this.loadWafConfig(),this.loadWafStatus()):s==="proxy"?this.loadProxyConfig():s==="email"&&this.loadEmailConfig()}},methods:{async loadProxyConfig(){try{const s=await this.$api.getProxyConfig();s.data&&(this.proxyConfig={enabled:s.data.enabled||!1,type:s.data.type||"http",host:s.data.host||"",port:s.data.port||1080})}catch{}},async saveProxyConfig(){try{await this.$api.updateProxyConfig(this.proxyConfig),this.$message.success("代理配置已保存")}catch(s){this.$message.error("保存失败: "+s.message)}},openProviderDialog(s){this.editingProvider=s,this.showProviderDialog=!0},openModelDialog(s,e){this.editingModel=e,this.showModelDialog=!0},async loadProviders(){try{const s=await this.$api.getProviders();this.providers=s.data||[];const e=this.providers.find(t=>t.isDefault);this.defaultProviderId=(e==null?void 0:e.id)||null,this.checkSongbingProvider()}catch(s){this.$message.error("加载提供商失败: "+s.message)}},async loadModels(){try{const s=await this.$api.getModels();this.models=s.data||[]}catch(s){this.$message.error("加载模型失败: "+s.message)}},async loadSkills(){try{const s=await this.$api.getSkills();this.skills=s.data||[]}catch{this.skills=[]}},async loadConfig(){var s;try{const e=await this.$api.getConfig("ai.maxToolIterations");(s=e.data)!=null&&s.value&&(this.config.maxToolIterations=parseInt(e.data.value))}catch{}},async deleteProvider(s){try{await this.$confirm("确定要删除该服务商吗?","提示",{type:"warning"}),await this.$api.deleteProvider(s),this.$message.success("删除成功"),await this.loadProviders()}catch(e){e!=="cancel"&&this.$message.error("删除失败: "+e.message)}},async deleteModel(s){try{await this.$confirm("确定要删除该模型吗?","提示",{type:"warning"}),await this.$api.deleteModel(s),this.$message.success("删除成功"),await this.loadModels()}catch(e){e!=="cancel"&&this.$message.error("删除失败: "+e.message)}},async saveConfig(s,e){try{await this.$api.setConfig(s,e),this.$message.success("配置已保存")}catch(t){this.$message.error("保存失败: "+t.message)}},async loadGatewayConfig(){try{const s=await this.$api.getDingtalkConfig();s.data&&(this.gateway={enabled:s.data.enabled||!1,clientId:s.data.clientId||"",clientSecret:s.data.clientSecret||""})}catch(s){console.error("Failed to load gateway config:",s)}},async loadGatewayStatus(){try{const s=await this.$api.getGatewayStatus();s.data&&(this.gatewayStatus={running:s.data.running||!1,configured:s.data.configured||!1})}catch(s){console.error("Failed to load gateway status:",s)}},async saveGatewayConfig(){try{await this.$api.updateDingtalkConfig(this.gateway),this.$message.success("网关配置已保存"),this.loadGatewayStatus()}catch(s){this.$message.error("保存失败: "+s.message)}},async toggleGateway(){this.gatewayLoading=!0;try{if(this.gatewayStatus.running)await this.$api.stopDingtalk(),this.$message.success("网关已停止");else{if(!this.gateway.clientId||!this.gateway.clientSecret){this.$message.error("请先配置 Client ID 和 Client Secret"),this.gatewayLoading=!1;return}await this.$api.updateDingtalkConfig(this.gateway),await this.$api.startDingtalk(),this.$message.success("网关已启动")}await this.loadGatewayStatus()}catch(s){this.$message.error("操作失败: "+s.message)}finally{this.gatewayLoading=!1}},async loadWafConfig(){try{const s=await this.$api.getWafConfig();s.data&&(this.wafGateway={serverIp:s.data.server_ip||"",secretKey:s.data.secret_key||""})}catch(s){console.error("Failed to load WAF config:",s)}},async loadWafStatus(){try{const s=await this.$api.getWafStatus();s.data&&(this.wafStatus={status:s.data.status||"stopped",configured:s.data.configured||!1})}catch(s){console.error("Failed to load WAF status:",s)}},async saveWafConfig(){try{await this.$api.updateWafConfig({server_ip:this.wafGateway.serverIp,secret_key:this.wafGateway.secretKey}),this.$message.success("WAF网关配置已保存"),this.loadWafStatus()}catch(s){this.$message.error("保存失败: "+s.message)}},async toggleWafGateway(){this.wafGatewayLoading=!0;try{if(this.wafStatus.status==="running")await this.$api.stopWaf(),this.$message.success("WAF网关已停止");else{if(!this.wafGateway.serverIp||!this.wafGateway.secretKey){this.$message.error("请先配置服务器IP和秘钥"),this.wafGatewayLoading=!1;return}await this.$api.updateWafConfig({server_ip:this.wafGateway.serverIp,secret_key:this.wafGateway.secretKey}),await this.$api.startWaf(),this.$message.success("WAF网关已启动")}await this.loadWafStatus()}catch(s){this.$message.error("操作失败: "+s.message)}finally{this.wafGatewayLoading=!1}},async loadEmailConfig(){try{const e=(await this.$api.getEmailConfigs()).data||[];if(e.length>0){const t=e[0];this.emailConfig={host:t.host||"",port:t.port||587,secure:!!t.secure,user:t.user||"",password:t.password||"",fromName:t.from_name||""},this.emailStatus.valid=null}else this.emailConfig={host:"",port:587,secure:!1,user:"",password:"",fromName:""},this.emailStatus.valid=null}catch(s){this.$message.error("加载邮件配置失败: "+s.message)}},async saveEmailConfig(){try{const e=((await this.$api.getEmailConfigs()).data||[])[0];e?await this.$api.updateEmailConfig(e.id,{host:this.emailConfig.host,port:this.emailConfig.port,secure:this.emailConfig.secure,user:this.emailConfig.user,password:this.emailConfig.password,from_name:this.emailConfig.fromName}):await this.$api.createEmailConfig({host:this.emailConfig.host,port:this.emailConfig.port,secure:this.emailConfig.secure,user:this.emailConfig.user,password:this.emailConfig.password,from_name:this.emailConfig.fromName,is_default:!0}),this.$message.success("配置已保存")}catch(s){this.$message.error("保存失败: "+s.message)}},async testEmailConfig(){try{const e=((await this.$api.getEmailConfigs()).data||[])[0];if(!e){this.$message.error("请先保存配置后再测试");return}this.emailLoading=!0;const t=await this.$api.validateEmailConfig(e.id);t.success?(this.$message.success("连接测试成功"),this.emailStatus.valid=!0):(this.$message.error("连接测试失败: "+t.error),this.emailStatus.valid=!1)}catch(s){this.$message.error("测试失败: "+s.message),this.emailStatus.valid=!1}finally{this.emailLoading=!1}},async handleExportConfig(){try{const s=await this.$api.exportConfig(),e=new Date,i=`config_${e.getFullYear().toString()+(e.getMonth()+1).toString().padStart(2,"0")+e.getDate().toString().padStart(2,"0")+"_"+e.getHours().toString().padStart(2,"0")+e.getMinutes().toString().padStart(2,"0")+e.getSeconds().toString().padStart(2,"0")}.yml`,n=window.URL.createObjectURL(s),r=document.createElement("a");r.href=n,r.download=i,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(n),this.$message.success("配置导出成功")}catch(s){this.$message.error("导出失败: "+s.message)}},handleImportConfig(){const s=document.createElement("input");s.type="file",s.accept=".yml,.yaml",s.onchange=async e=>{const t=e.target.files[0];if(t)try{const i=await t.text(),n=await this.$api.importConfig(i);n.success?(this.$message.success("配置导入成功"),await this.loadProviders(),await this.loadModels(),await this.loadGatewayConfig(),this.loadWafConfig(),this.loadEmailConfig()):this.$message.error("导入失败: "+n.error)}catch(i){this.$message.error("导入失败: "+i.message)}},s.click()},async loadSongbingConfig(){try{const s=await this.$api.getSongbingConfig();this.songbingConfig=s.data}catch(s){console.error("Failed to load songbing config:",s)}},checkSongbingProvider(){this.songbingProvider=this.providers.find(s=>s.name==="自建AI平台")||null},authSongbing(){this.authForm.platformUrl=this.songbingConfig.platformUrl,this.showAuthDialog=!0},async confirmAuthSongbing(){const{platformUrl:s}=this.authForm;if(!s){this.$message.error("请输入平台地址");return}if(!s.startsWith("http://")&&!s.startsWith("https://")){this.$message.error("平台地址必须以 http:// 或 https:// 开头");return}this.showAuthDialog=!1,this.authLoading=!0,this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null);try{const e=await this.$api.startSongbingAuth(s),{key:t,auth_url:i}=e.data;window.open(s+i,"_blank"),this.$message.info("请在打开的页面完成授权,认证中...");let n=0;this.pollTimer=setInterval(async()=>{var r;if(n++,n>=100){clearInterval(this.pollTimer),this.pollTimer=null,this.$message.warning("认证超时,请重试"),this.authLoading=!1;return}try{const o=await this.$api.verifySongbingAuth(t);(r=o.data)!=null&&r.active&&(clearInterval(this.pollTimer),this.pollTimer=null,this.$message.success(`自建AI平台 认证成功!已同步 ${o.data.syncedModels} 个模型`),await this.loadProviders(),await this.loadModels(),this.checkSongbingProvider(),this.authLoading=!1)}catch{}},3e3)}catch(e){this.$message.error("认证失败: "+e.message),this.authLoading=!1}},async cancelSongbingAuth(){try{await this.$confirm("确定要取消认证吗?取消后已同步的模型将被删除。","提示",{type:"warning"}),await this.$api.cancelSongbingAuth(),this.$message.success("已取消认证"),await this.loadProviders(),await this.loadModels(),this.songbingProvider=null}catch(s){s!=="cancel"&&this.$message.error("取消认证失败: "+s.message)}},async syncSongbingModels(){if(!this.songbingProvider){this.$message.warning("请先完成认证");return}try{const s=await this.$api.syncSongbingModels();this.$message.success(`同步成功,新增 ${s.data.count} 个模型`),await this.loadModels()}catch(s){this.$message.error("同步模型失败: "+s.message)}}},beforeDestroy(){this.pollTimer&&clearInterval(this.pollTimer)}};var KFe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex-1 flex overflow-hidden bg-[#1e1e1e]"},[t("aside",{staticClass:"w-[220px] bg-sidebar border-r border-border shrink-0 py-4"},[t("h2",{staticClass:"text-white font-bold text-lg px-4 mb-4"},[e._v("设置")]),t("nav",{staticClass:"space-y-1"},e._l(e.tabs,function(i){return t("button",{key:i.name,staticClass:"w-full text-left px-4 py-2 text-sm flex items-center gap-2 transition-colors",class:e.activeTab===i.name?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(n){e.activeTab=i.name}}},[t("i",{class:i.icon}),e._v(" "+e._s(i.label)+" ")])}),0)]),t("main",{staticClass:"flex-1 overflow-y-auto p-6"},[t("div",{staticClass:"max-w-3xl mx-auto"},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="providers",expression:"activeTab === 'providers'"}]},[t("ProviderList",{attrs:{providers:e.providers,models:e.models,"songbing-provider":e.songbingProvider},on:{"add-provider":function(i){return e.openProviderDialog(null)},"edit-provider":function(i){return e.openProviderDialog(i)},"delete-provider":e.deleteProvider,"add-model":function(i){return e.openModelDialog(i,null)},"edit-model":function(i){return e.openModelDialog(i.providerId,i)},"delete-model":e.deleteModel,"export-config":e.handleExportConfig,"import-config":e.handleImportConfig,"auth-songbing":e.authSongbing,"sync-songbing-models":e.syncSongbingModels,"cancel-songbing-auth":e.cancelSongbingAuth}})],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="skills",expression:"activeTab === 'skills'"}]},[t("h3",{staticClass:"text-xl text-white mb-4"},[e._v("Skills")]),t("SkillsList",{attrs:{skills:e.skills}})],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="advanced",expression:"activeTab === 'advanced'"}]},[t("h3",{staticClass:"text-xl text-white mb-4"},[e._v("高级设置")]),t("el-form",{staticClass:"advanced-form",attrs:{"label-width":"150px"}},[t("el-form-item",{attrs:{label:"最大工具轮数"}},[t("el-input-number",{attrs:{min:1,max:100},on:{change:function(i){return e.saveConfig("maxToolIterations",i)}},model:{value:e.config.maxToolIterations,callback:function(i){e.$set(e.config,"maxToolIterations",i)},expression:"config.maxToolIterations"}})],1),t("el-form-item",{attrs:{label:"会话压缩阈值"}},[t("el-input-number",{attrs:{min:1,max:100},on:{change:function(i){return e.saveConfig("maxSessionCompression",i)}},model:{value:e.config.maxSessionCompression,callback:function(i){e.$set(e.config,"maxSessionCompression",i)},expression:"config.maxSessionCompression"}})],1),t("el-form-item",{attrs:{label:"Web 服务端口"}},[t("el-input-number",{attrs:{min:1024,max:65535},on:{change:function(i){return e.saveConfig("web.port",i)}},model:{value:e.config.webPort,callback:function(i){e.$set(e.config,"webPort",i)},expression:"config.webPort"}})],1)],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="proxy",expression:"activeTab === 'proxy'"}]},[t("h3",{staticClass:"text-xl text-white mb-4"},[e._v("代理设置")]),t("el-form",{staticClass:"advanced-form",attrs:{"label-width":"150px"}},[t("el-form-item",{attrs:{label:"启用代理"}},[t("el-switch",{on:{change:e.saveProxyConfig},model:{value:e.proxyConfig.enabled,callback:function(i){e.$set(e.proxyConfig,"enabled",i)},expression:"proxyConfig.enabled"}})],1),t("el-form-item",{attrs:{label:"代理类型"}},[t("el-select",{attrs:{disabled:!e.proxyConfig.enabled},on:{change:e.saveProxyConfig},model:{value:e.proxyConfig.type,callback:function(i){e.$set(e.proxyConfig,"type",i)},expression:"proxyConfig.type"}},[t("el-option",{attrs:{label:"HTTP",value:"http"}}),t("el-option",{attrs:{label:"SOCKS5",value:"socks5"}})],1)],1),t("el-form-item",{attrs:{label:"代理IP"}},[t("el-input",{attrs:{disabled:!e.proxyConfig.enabled},on:{blur:e.saveProxyConfig},model:{value:e.proxyConfig.host,callback:function(i){e.$set(e.proxyConfig,"host",i)},expression:"proxyConfig.host"}})],1),t("el-form-item",{attrs:{label:"代理端口"}},[t("el-input-number",{attrs:{min:1,max:65535,disabled:!e.proxyConfig.enabled},on:{change:e.saveProxyConfig},model:{value:e.proxyConfig.port,callback:function(i){e.$set(e.proxyConfig,"port",i)},expression:"proxyConfig.port"}})],1)],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="gateway",expression:"activeTab === 'gateway'"}]},[t("h3",{staticClass:"text-xl text-white mb-4"},[e._v("网关配置")]),t("el-form",{staticClass:"gateway-form",attrs:{"label-width":"150px"}},[t("el-form-item",{attrs:{label:"启用钉钉机器人"}},[t("el-switch",{on:{change:e.saveGatewayConfig},model:{value:e.gateway.enabled,callback:function(i){e.$set(e.gateway,"enabled",i)},expression:"gateway.enabled"}})],1),t("el-form-item",{attrs:{label:"Client ID"}},[t("el-input",{attrs:{placeholder:"请输入Client ID"},on:{blur:e.saveGatewayConfig},model:{value:e.gateway.clientId,callback:function(i){e.$set(e.gateway,"clientId",i)},expression:"gateway.clientId"}})],1),t("el-form-item",{attrs:{label:"Client Secret"}},[t("el-input",{attrs:{type:"password",placeholder:"请输入Client Secret"},on:{blur:e.saveGatewayConfig},model:{value:e.gateway.clientSecret,callback:function(i){e.$set(e.gateway,"clientSecret",i)},expression:"gateway.clientSecret"}})],1),t("el-form-item",{attrs:{label:"运行状态"}},[t("el-tag",{attrs:{type:e.gatewayStatus.running?"success":"info"}},[e._v(" "+e._s(e.gatewayStatus.running?"运行中":"已停止")+" ")]),e.gatewayStatus.configured&&!e.gatewayStatus.running?t("span",{staticClass:"text-textMuted text-sm ml-2"},[e._v(" (配置已保存,可启动) ")]):e._e()],1),t("el-form-item",[t("el-button",{attrs:{type:"primary",loading:e.gatewayLoading},on:{click:e.toggleGateway}},[e._v(" "+e._s(e.gatewayStatus.running?"停止":"启动")+" ")])],1)],1),t("h3",{staticClass:"text-xl text-white mb-4 mt-8"},[e._v("梓豪WAF网关配置")]),t("el-form",{staticClass:"gateway-form",attrs:{"label-width":"150px"}},[t("el-form-item",{attrs:{label:"服务器IP"}},[t("el-input",{attrs:{placeholder:"请输入服务器IP地址"},on:{blur:e.saveWafConfig},model:{value:e.wafGateway.serverIp,callback:function(i){e.$set(e.wafGateway,"serverIp",i)},expression:"wafGateway.serverIp"}})],1),t("el-form-item",{attrs:{label:"秘钥"}},[t("el-input",{attrs:{type:"password",placeholder:"请输入秘钥","show-password":""},on:{blur:e.saveWafConfig},model:{value:e.wafGateway.secretKey,callback:function(i){e.$set(e.wafGateway,"secretKey",i)},expression:"wafGateway.secretKey"}})],1),t("el-form-item",{attrs:{label:"运行状态"}},[t("div",{staticClass:"flex items-center gap-2"},[t("span",{staticClass:"w-2 h-2 rounded-full",class:e.wafStatus.status==="running"?"bg-green-500":"bg-gray-400"}),t("el-tag",{attrs:{type:e.wafStatus.status==="running"?"success":"info"}},[e._v(" "+e._s(e.wafStatus.status==="running"?"运行中":"已停止")+" ")])],1)]),t("el-form-item",[t("el-button",{attrs:{type:"primary",loading:e.wafGatewayLoading,disabled:!e.wafStatus.configured},on:{click:e.toggleWafGateway}},[e._v(" "+e._s(e.wafStatus.status==="running"?"停止":"启动")+" ")])],1)],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="email",expression:"activeTab === 'email'"}]},[t("h3",{staticClass:"text-xl text-white mb-4"},[e._v("邮件配置")]),t("el-form",{staticClass:"gateway-form",attrs:{"label-width":"150px"}},[t("el-form-item",{attrs:{label:"SMTP 服务器"}},[t("el-input",{attrs:{placeholder:"smtp.example.com"},on:{blur:e.saveEmailConfig},model:{value:e.emailConfig.host,callback:function(i){e.$set(e.emailConfig,"host",i)},expression:"emailConfig.host"}})],1),t("el-form-item",{attrs:{label:"端口"}},[t("el-input-number",{attrs:{min:1,max:65535},on:{change:e.saveEmailConfig},model:{value:e.emailConfig.port,callback:function(i){e.$set(e.emailConfig,"port",i)},expression:"emailConfig.port"}})],1),t("el-form-item",{attrs:{label:"使用 SSL/TLS"}},[t("el-switch",{on:{change:e.saveEmailConfig},model:{value:e.emailConfig.secure,callback:function(i){e.$set(e.emailConfig,"secure",i)},expression:"emailConfig.secure"}})],1),t("el-form-item",{attrs:{label:"用户名"}},[t("el-input",{attrs:{placeholder:"邮箱地址"},on:{blur:e.saveEmailConfig},model:{value:e.emailConfig.user,callback:function(i){e.$set(e.emailConfig,"user",i)},expression:"emailConfig.user"}})],1),t("el-form-item",{attrs:{label:"密码/授权码"}},[t("el-input",{attrs:{type:"password",placeholder:"邮箱密码或授权码","show-password":""},on:{blur:e.saveEmailConfig},model:{value:e.emailConfig.password,callback:function(i){e.$set(e.emailConfig,"password",i)},expression:"emailConfig.password"}})],1),t("el-form-item",{attrs:{label:"发件人名称"}},[t("el-input",{attrs:{placeholder:"显示的发件人名称(可选)"},on:{blur:e.saveEmailConfig},model:{value:e.emailConfig.fromName,callback:function(i){e.$set(e.emailConfig,"fromName",i)},expression:"emailConfig.fromName"}})],1),t("el-form-item",{attrs:{label:"运行状态"}},[t("el-tag",{attrs:{type:e.emailStatus.valid?"success":"info"}},[e._v(" "+e._s(e.emailStatus.valid?"配置有效":e.emailStatus.valid===!1?"配置无效":"未配置")+" ")])],1),t("el-form-item",[t("el-button",{attrs:{type:"primary",loading:e.emailLoading},on:{click:e.testEmailConfig}},[e._v("测试连接")])],1)],1)],1)])]),t("ProviderDialog",{attrs:{visible:e.showProviderDialog,"editing-provider":e.editingProvider},on:{"update:visible":function(i){e.showProviderDialog=i},success:e.loadProviders}}),t("ModelDialog",{attrs:{visible:e.showModelDialog,"editing-model":e.editingModel,providers:e.providers,"default-provider-id":e.defaultProviderId},on:{"update:visible":function(i){e.showModelDialog=i},success:e.loadModels}}),t("el-dialog",{attrs:{title:"自建AI平台认证",visible:e.showAuthDialog,width:"500px","close-on-click-modal":!1},on:{"update:visible":function(i){e.showAuthDialog=i}}},[t("el-form",{attrs:{"label-width":"80px"}},[t("el-form-item",{attrs:{label:"平台地址"}},[t("el-input",{model:{value:e.authForm.platformUrl,callback:function(i){e.$set(e.authForm,"platformUrl",i)},expression:"authForm.platformUrl"}})],1),t("el-alert",{staticStyle:{"margin-top":"10px"},attrs:{title:"注意:填写您的自建AI平台服务地址",type:"info",closable:!1}})],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(i){e.showAuthDialog=!1}}},[e._v("取消")]),t("el-button",{attrs:{type:"primary",loading:e.authLoading},on:{click:e.confirmAuthSongbing}},[e._v("开始认证")])],1)],1)],1)},GFe=[],YFe=en(qFe,KFe,GFe,!1,null,"c13c27a0");const pve=YFe.exports,ZFe={name:"FileTreeNode",props:{node:{type:Object,required:!0},level:{type:Number,default:0},selectedPath:{type:String,default:""},expandedPaths:{type:Set,default:()=>new Set}},data(){return{expanded:!1,loading:!1,loadedChildren:this.node.children||[]}},computed:{isSelected(){return this.selectedPath===this.node.path}},watch:{node:{immediate:!0,handler(s){s.children&&s.children.length>0&&(this.loadedChildren=s.children)}},expandedPaths:{immediate:!0,handler(s){this.node.is_directory&&(s.has(this.node.path)&&!this.expanded?this.ensureExpanded():!s.has(this.node.path)&&this.expanded&&(this.expanded=!1))}}},methods:{async toggleExpand(){if(this.node.is_directory)if(!this.expanded&&this.loadedChildren.length===0&&this.node.has_children){this.loading=!0;try{this.$emit("load-children",{path:this.node.path,callback:s=>{this.loadedChildren=s,this.expanded=!0,this.loading=!1,this.$emit("expand-path",this.node.path)}})}catch(s){console.error("Failed to load children:",s),this.loading=!1}}else this.expanded=!this.expanded,this.expanded?this.$emit("expand-path",this.node.path):this.$emit("collapse-path",this.node.path)},ensureExpanded(){this.expanded||(this.loadedChildren.length===0&&this.node.has_children?(this.loading=!0,this.$emit("load-children",{path:this.node.path,callback:s=>{this.loadedChildren=s,this.expanded=!0,this.loading=!1}})):this.expanded=!0)},handleClick(){this.$emit("select",this.node),this.node.is_directory&&this.toggleExpand()},handleDblClick(){this.node.is_directory?this.toggleExpand():this.$emit("open-file",this.node)},handleContextMenu(s){s.stopPropagation(),this.$emit("contextmenu",s,this.node)},getFileIcon(s,e){if(e)return"fa-solid fa-folder text-yellow-500";const t=s.split(".").pop().toLowerCase(),i=s.toLowerCase(),n={js:"fa-brands fa-js text-yellow-400",jsx:"fa-brands fa-react text-blue-400",ts:"fa-brands fa-js text-blue-400",tsx:"fa-brands fa-react text-blue-400",html:"fa-brands fa-html5 text-orange-500",htm:"fa-brands fa-html5 text-orange-500",css:"fa-brands fa-css3 text-blue-400",scss:"fa-brands fa-sass text-pink-400",sass:"fa-brands fa-sass text-pink-400",vue:"fa-brands fa-vuejs text-green-400",py:"fa-brands fa-python text-blue-500",pyc:"fa-brands fa-python text-gray-400",json:"fa-solid fa-file-code text-yellow-300",yaml:"fa-solid fa-file-code text-blue-300",yml:"fa-solid fa-file-code text-blue-300",xml:"fa-solid fa-file-code text-orange-300",md:"fa-solid fa-file-lines text-gray-400",markdown:"fa-solid fa-file-lines text-gray-400",sql:"fa-solid fa-database text-gray-400",sh:"fa-solid fa-terminal text-green-400",bash:"fa-solid fa-terminal text-green-400",go:"fa-brands fa-golang text-cyan-400",rs:"fa-brands fa-rust text-orange-400",java:"fa-brands fa-java text-red-400",kt:"fa-brands fa-android text-purple-400",swift:"fa-brands fa-apple text-blue-300",c:"fa-solid fa-file-code text-blue-300",cpp:"fa-solid fa-file-code text-blue-400",cc:"fa-solid fa-file-code text-blue-400",h:"fa-solid fa-file-code text-blue-300",hpp:"fa-solid fa-file-code text-blue-400",cs:"fa-brands fa-microsoft text-purple-400",rb:"fa-solid fa-gem text-red-400",php:"fa-brands fa-php text-purple-400",dockerfile:"fa-brands fa-docker text-blue-400",gitignore:"fa-brands fa-git text-red-400",gitattributes:"fa-brands fa-git text-red-400",license:"fa-solid fa-scale-balanced text-yellow-400",png:"fa-solid fa-image text-green-400",jpg:"fa-solid fa-image text-green-400",jpeg:"fa-solid fa-image text-green-400",gif:"fa-solid fa-image text-green-400",svg:"fa-solid fa-image text-green-400",ico:"fa-solid fa-image text-green-400",webp:"fa-solid fa-image text-green-400",bmp:"fa-solid fa-image text-green-400",mp4:"fa-solid fa-film text-purple-400",avi:"fa-solid fa-film text-purple-400",mov:"fa-solid fa-film text-purple-400",mkv:"fa-solid fa-film text-purple-400",mp3:"fa-solid fa-music text-pink-400",wav:"fa-solid fa-music text-pink-400",flac:"fa-solid fa-music text-pink-400",woff:"fa-solid fa-font text-blue-400",woff2:"fa-solid fa-font text-blue-400",ttf:"fa-solid fa-font text-blue-400",otf:"fa-solid fa-font text-blue-400",eot:"fa-solid fa-font text-blue-400",zip:"fa-solid fa-file-zipper text-yellow-600",rar:"fa-solid fa-file-zipper text-yellow-600","7z":"fa-solid fa-file-zipper text-yellow-600",tar:"fa-solid fa-file-zipper text-yellow-600",gz:"fa-solid fa-file-zipper text-yellow-600",pdf:"fa-solid fa-file-pdf text-red-500",doc:"fa-solid fa-file-word text-blue-600",docx:"fa-solid fa-file-word text-blue-600",xls:"fa-solid fa-file-excel text-green-600",xlsx:"fa-solid fa-file-excel text-green-600",ppt:"fa-solid fa-file-powerpoint text-orange-600",pptx:"fa-solid fa-file-powerpoint text-orange-600"};return i==="dockerfile"?n.dockerfile:i===".gitignore"?n.gitignore:i===".gitattributes"?n.gitattributes:i==="license"||i.startsWith("license")?n.license:i.startsWith("readme")?n.md:n[t]||"fa-solid fa-file text-gray-400"}}};var XFe=function(){var i;var e=this,t=e._self._c;return t("div",{staticClass:"file-tree-node"},[t("div",{staticClass:"node-content",class:{selected:e.isSelected,directory:e.node.is_directory},style:{paddingLeft:e.level*16+4+"px"},on:{click:e.handleClick,dblclick:e.handleDblClick,contextmenu:function(n){return n.preventDefault(),e.handleContextMenu.apply(null,arguments)}}},[e.node.is_directory?t("span",{staticClass:"expand-icon",on:{click:function(n){return n.stopPropagation(),e.toggleExpand.apply(null,arguments)}}},[e.loading?t("i",{staticClass:"fa-solid fa-spinner fa-spin"}):e.expanded?t("i",{staticClass:"fa-solid fa-chevron-down"}):e.node.has_children||e.node.children&&e.node.children.length>0?t("i",{staticClass:"fa-solid fa-chevron-right"}):t("span",{staticClass:"placeholder"})]):t("span",{staticClass:"expand-icon placeholder"}),t("span",{staticClass:"node-icon"},[t("i",{class:e.getFileIcon(e.node.name,e.node.is_directory)})]),t("span",{staticClass:"node-name"},[e._v(e._s(e.node.name))])]),e.node.is_directory&&e.expanded&&(e.loadedChildren.length>0||((i=e.node.children)==null?void 0:i.length)>0)?t("div",{staticClass:"children"},e._l(e.loadedChildren.length>0?e.loadedChildren:e.node.children,function(n){return t("file-tree-node",{key:n.path,attrs:{node:n,level:e.level+1,"selected-path":e.selectedPath,"expanded-paths":e.expandedPaths},on:{select:function(r){return e.$emit("select",r)},"open-file":function(r){return e.$emit("open-file",r)},"load-children":function(r){return e.$emit("load-children",r)},contextmenu:(r,o)=>e.$emit("contextmenu",r,o),"expand-path":function(r){return e.$emit("expand-path",r)},"collapse-path":function(r){return e.$emit("collapse-path",r)}}})}),1):e._e()])},QFe=[],JFe=en(ZFe,XFe,QFe,!1,null,"4040e3a8");const e4e=JFe.exports,t4e={name:"CopyPathDialog",data(){return{visible:!1,path:""}},methods:{open(s){this.path=s,this.visible=!0},handleClose(){this.path=""},handleCopy(){navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(this.path).then(()=>{this.$message.success("路径已复制")}).catch(()=>{this.$message.info("请手动 Ctrl+C 复制")}):this.$message.info("请手动 Ctrl+C 复制"),this.visible=!1}}};var i4e=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:"文件路径",visible:e.visible,width:"500px","close-on-click-modal":!0},on:{"update:visible":function(i){e.visible=i},close:e.handleClose}},[t("div",{staticClass:"flex gap-2"},[t("el-input",{staticClass:"flex-1",attrs:{readonly:""},model:{value:e.path,callback:function(i){e.path=i},expression:"path"}}),t("el-button",{attrs:{type:"primary"},on:{click:e.handleCopy}},[e._v("复制")])],1)])},n4e=[],s4e=en(t4e,i4e,n4e,!1,null,null);const r4e=s4e.exports;function bc(s,e=0){return s[s.length-(1+e)]}function o4e(s){if(s.length===0)throw new Error("Invalid tail call");return[s.slice(0,s.length-1),s[s.length-1]]}function Mn(s,e,t=(i,n)=>i===n){if(s===e)return!0;if(!s||!e||s.length!==e.length)return!1;for(let i=0,n=s.length;i<n;i++)if(!t(s[i],e[i]))return!1;return!0}function a4e(s,e){const t=s.length-1;e<t&&(s[e]=s[t]),s.pop()}function _E(s,e,t){return l4e(s.length,i=>t(s[i],e))}function l4e(s,e){let t=0,i=s-1;for(;t<=i;){const n=(t+i)/2|0,r=e(n);if(r<0)t=n+1;else if(r>0)i=n-1;else return n}return-(t+1)}function EU(s,e,t){if(s=s|0,s>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],n=[],r=[],o=[];for(const a of e){const l=t(a,i);l<0?n.push(a):l>0?r.push(a):o.push(a)}return s<n.length?EU(s,n,t):s<n.length+o.length?o[0]:EU(s-(n.length+o.length),r,t)}function oce(s,e){const t=[];let i;for(const n of s.slice(0).sort(e))!i||e(i[0],n)!==0?(i=[n],t.push(i)):i.push(n);return t}function*fee(s,e){let t,i;for(const n of s)i!==void 0&&e(i,n)?t.push(n):(t&&(yield t),t=[n]),i=n;t&&(yield t)}function mve(s,e){for(let t=0;t<=s.length;t++)e(t===0?void 0:s[t-1],t===s.length?void 0:s[t])}function c4e(s,e){for(let t=0;t<s.length;t++)e(t===0?void 0:s[t-1],s[t],t+1===s.length?void 0:s[t+1])}function Id(s){return s.filter(e=>!!e)}function ace(s){let e=0;for(let t=0;t<s.length;t++)s[t]&&(s[e]=s[t],e+=1);s.length=e}function _ve(s){return!Array.isArray(s)||s.length===0}function xo(s){return Array.isArray(s)&&s.length>0}function Mg(s,e=t=>t){const t=new Set;return s.filter(i=>{const n=e(i);return t.has(n)?!1:(t.add(n),!0)})}function gee(s,e){return s.length>0?s[0]:e}function ua(s,e){let t=typeof e=="number"?s:0;typeof e=="number"?t=s:(t=0,e=s);const i=[];if(t<=e)for(let n=t;n<e;n++)i.push(n);else for(let n=t;n>e;n--)i.push(n);return i}function mV(s,e,t){const i=s.slice(0,e),n=s.slice(e);return i.concat(t,n)}function P$(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.unshift(e))}function yA(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.push(e))}function TU(s,e){for(const t of e)s.push(t)}function pee(s){return Array.isArray(s)?s:[s]}function d4e(s,e,t){const i=vve(s,e),n=s.length,r=t.length;s.length=n+r;for(let o=n-1;o>=i;o--)s[o+r]=s[o];for(let o=0;o<r;o++)s[o+i]=t[o]}function lce(s,e,t,i){const n=vve(s,e);let r=s.splice(n,t);return r===void 0&&(r=[]),d4e(s,n,i),r}function vve(s,e){return e<0?Math.max(e+s.length,0):Math.min(e,s.length)}var vE;(function(s){function e(r){return r<0}s.isLessThan=e;function t(r){return r<=0}s.isLessThanOrEqual=t;function i(r){return r>0}s.isGreaterThan=i;function n(r){return r===0}s.isNeitherLessOrGreaterThan=n,s.greaterThan=1,s.lessThan=-1,s.neitherLessOrGreaterThan=0})(vE||(vE={}));function Ko(s,e){return(t,i)=>e(s(t),s(i))}function u4e(...s){return(e,t)=>{for(const i of s){const n=i(e,t);if(!vE.isNeitherLessOrGreaterThan(n))return n}return vE.neitherLessOrGreaterThan}}const kd=(s,e)=>s-e,h4e=(s,e)=>kd(s?1:0,e?1:0);function bve(s){return(e,t)=>-s(e,t)}class Rg{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<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;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}}const k0=class k0{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new k0(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new k0(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||vE.isGreaterThan(e(n,t)))&&(i=!1,t=n),!0)),t}};k0.empty=new k0(e=>{});let Nb=k0;class o4{constructor(e){this._indexMap=e}static createSortPermutation(e,t){const i=Array.from(e.keys()).sort((n,r)=>t(e[n],e[r]));return new o4(i)}apply(e){return e.map((t,i)=>e[this._indexMap[i]])}inverse(){const e=this._indexMap.slice();for(let t=0;t<this._indexMap.length;t++)e[this._indexMap[t]]=t;return new o4(e)}}function ya(s){return typeof s=="string"}function ar(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&!(s instanceof RegExp)&&!(s instanceof Date)}function f4e(s){const e=Object.getPrototypeOf(Uint8Array);return typeof s=="object"&&s instanceof e}function Jm(s){return typeof s=="number"&&!isNaN(s)}function cce(s){return!!s&&typeof s[Symbol.iterator]=="function"}function Cve(s){return s===!0||s===!1}function So(s){return typeof s>"u"}function jh(s){return!Wl(s)}function Wl(s){return So(s)||s===null}function yi(s,e){if(!s)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function om(s){if(Wl(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function bE(s){return typeof s=="function"}function g4e(s,e){const t=Math.min(s.length,e.length);for(let i=0;i<t;i++)p4e(s[i],e[i])}function p4e(s,e){if(ya(e)){if(typeof s!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(bE(e)){try{if(s instanceof e)return}catch{}if(!Wl(s)&&s.constructor===e||e.length===1&&e.call(void 0,s)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function Yf(s){if(!s||typeof s!="object"||s instanceof RegExp)return s;const e=Array.isArray(s)?[]:{};return Object.entries(s).forEach(([t,i])=>{e[t]=i&&typeof i=="object"?Yf(i):i}),e}function m4e(s){if(!s||typeof s!="object")return s;const e=[s];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(yve.call(t,i)){const n=t[i];typeof n=="object"&&!Object.isFrozen(n)&&!f4e(n)&&e.push(n)}}return s}const yve=Object.prototype.hasOwnProperty;function wve(s,e){return NU(s,e,new Set)}function NU(s,e,t){if(Wl(s))return s;const i=e(s);if(typeof i<"u")return i;if(Array.isArray(s)){const n=[];for(const r of s)n.push(NU(r,e,t));return n}if(ar(s)){if(t.has(s))throw new Error("Cannot clone recursive data-structure");t.add(s);const n={};for(const r in s)yve.call(s,r)&&(n[r]=NU(s[r],e,t));return t.delete(s),n}return s}function _V(s,e,t=!0){return ar(s)?(ar(e)&&Object.keys(e).forEach(i=>{i in s?t&&(ar(s[i])&&ar(e[i])?_V(s[i],e[i],t):s[i]=e[i]):s[i]=e[i]}),s):e}function sl(s,e){if(s===e)return!0;if(s==null||e===null||e===void 0||typeof s!=typeof e||typeof s!="object"||Array.isArray(s)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(s)){if(s.length!==e.length)return!1;for(t=0;t<s.length;t++)if(!sl(s[t],e[t]))return!1}else{const n=[];for(i in s)n.push(i);n.sort();const r=[];for(i in e)r.push(i);if(r.sort(),!sl(n,r))return!1;for(t=0;t<n.length;t++)if(!sl(s[n[t]],e[n[t]]))return!1}return!0}function _4e(s){let e=[];for(;Object.prototype!==s;)e=e.concat(Object.getOwnPropertyNames(s)),s=Object.getPrototypeOf(s);return e}function MU(s){const e=[];for(const t of _4e(s))typeof s[t]=="function"&&e.push(t);return e}function v4e(s,e){const t=n=>function(){const r=Array.prototype.slice.call(arguments,0);return e(n,r)},i={};for(const n of s)i[n]=t(n);return i}function Sve(){return globalThis._VSCODE_NLS_MESSAGES}function mee(){return globalThis._VSCODE_NLS_LANGUAGE}const b4e=mee()==="pseudo"||typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function a4(s,e){let t;return e.length===0?t=s:t=s.replace(/\{(\d+)\}/g,(i,n)=>{const r=n[0],o=e[r];let a=i;return typeof o=="string"?a=o:(typeof o=="number"||typeof o=="boolean"||o===void 0||o===null)&&(a=String(o)),a}),b4e&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function w(s,e,...t){return a4(typeof s=="number"?xve(s,e):e,t)}function xve(s,e){var i;const t=(i=Sve())==null?void 0:i[s];if(typeof t!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${s} !!!`)}return t}function Lt(s,e,...t){let i;typeof s=="number"?i=xve(s,e):i=e;const n=a4(i,t);return{value:n,original:e===i?n:a4(e,t)}}const e0="en";let l4=!1,c4=!1,G2=!1,kve=!1,_ee=!1,vee=!1,Lve=!1,wA,Y2=e0,dce=e0,C4e,Qd;const wg=globalThis;let Fo;var Npe;typeof wg.vscode<"u"&&typeof wg.vscode.process<"u"?Fo=wg.vscode.process:typeof process<"u"&&typeof((Npe=process==null?void 0:process.versions)==null?void 0:Npe.node)=="string"&&(Fo=process);var Mpe;const y4e=typeof((Mpe=Fo==null?void 0:Fo.versions)==null?void 0:Mpe.electron)=="string",w4e=y4e&&(Fo==null?void 0:Fo.type)==="renderer";var Rpe;if(typeof Fo=="object"){l4=Fo.platform==="win32",c4=Fo.platform==="darwin",G2=Fo.platform==="linux",G2&&Fo.env.SNAP&&Fo.env.SNAP_REVISION,Fo.env.CI||Fo.env.BUILD_ARTIFACTSTAGINGDIRECTORY,wA=e0,Y2=e0;const s=Fo.env.VSCODE_NLS_CONFIG;if(s)try{const e=JSON.parse(s);wA=e.userLocale,dce=e.osLocale,Y2=e.resolvedLanguage||e0,C4e=(Rpe=e.languagePack)==null?void 0:Rpe.translationsConfigFile}catch{}kve=!0}else typeof navigator=="object"&&!w4e?(Qd=navigator.userAgent,l4=Qd.indexOf("Windows")>=0,c4=Qd.indexOf("Macintosh")>=0,vee=(Qd.indexOf("Macintosh")>=0||Qd.indexOf("iPad")>=0||Qd.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,G2=Qd.indexOf("Linux")>=0,Lve=(Qd==null?void 0:Qd.indexOf("Mobi"))>=0,_ee=!0,Y2=mee()||e0,wA=navigator.language.toLowerCase(),dce=wA):console.error("Unable to resolve platform.");const Kr=l4,ii=c4,Zo=G2,Yh=kve,My=_ee,S4e=_ee&&typeof wg.importScripts=="function",x4e=S4e?wg.origin:void 0,Ru=vee,Dve=Lve,Zh=Qd,k4e=Y2,L4e=typeof wg.postMessage=="function"&&!wg.importScripts,Ive=(()=>{if(L4e){const s=[];wg.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,n=s.length;i<n;i++){const r=s[i];if(r.id===t.data.vscodeScheduleAsyncWork){s.splice(i,1),r.callback();return}}});let e=0;return t=>{const i=++e;s.push({id:i,callback:t}),wg.postMessage({vscodeScheduleAsyncWork:i},"*")}}return s=>setTimeout(s)})(),il=c4||vee?2:l4?1:3;let uce=!0,hce=!1;function Eve(){if(!hce){hce=!0;const s=new Uint8Array(2);s[0]=1,s[1]=2,uce=new Uint16Array(s.buffer)[0]===513}return uce}const Tve=!!(Zh&&Zh.indexOf("Chrome")>=0),D4e=!!(Zh&&Zh.indexOf("Firefox")>=0),I4e=!!(!Tve&&Zh&&Zh.indexOf("Safari")>=0),E4e=!!(Zh&&Zh.indexOf("Edg/")>=0),T4e=!!(Zh&&Zh.indexOf("Android")>=0),to={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var hi;(function(s){function e(I){return I&&typeof I=="object"&&typeof I[Symbol.iterator]=="function"}s.is=e;const t=Object.freeze([]);function i(){return t}s.empty=i;function*n(I){yield I}s.single=n;function r(I){return e(I)?I:n(I)}s.wrap=r;function o(I){return I||t}s.from=o;function*a(I){for(let E=I.length-1;E>=0;E--)yield I[E]}s.reverse=a;function l(I){return!I||I[Symbol.iterator]().next().done===!0}s.isEmpty=l;function d(I){return I[Symbol.iterator]().next().value}s.first=d;function h(I,E){let R=0;for(const M of I)if(E(M,R++))return!0;return!1}s.some=h;function f(I,E){for(const R of I)if(E(R))return R}s.find=f;function*p(I,E){for(const R of I)E(R)&&(yield R)}s.filter=p;function*m(I,E){let R=0;for(const M of I)yield E(M,R++)}s.map=m;function*v(I,E){let R=0;for(const M of I)yield*E(M,R++)}s.flatMap=v;function*b(...I){for(const E of I)yield*E}s.concat=b;function y(I,E,R){let M=R;for(const O of I)M=E(M,O);return M}s.reduce=y;function*x(I,E,R=I.length){for(E<0&&(E+=I.length),R<0?R+=I.length:R>I.length&&(R=I.length);E<R;E++)yield I[E]}s.slice=x;function D(I,E=Number.POSITIVE_INFINITY){const R=[];if(E===0)return[R,I];const M=I[Symbol.iterator]();for(let O=0;O<E;O++){const V=M.next();if(V.done)return[R,s.empty()];R.push(V.value)}return[R,{[Symbol.iterator](){return M}}]}s.consume=D;async function S(I){const E=[];for await(const R of I)E.push(R);return Promise.resolve(E)}s.asyncToArray=S})(hi||(hi={}));var pg;let qs=(pg=class{constructor(e){this.element=e,this.next=pg.Undefined,this.prev=pg.Undefined}},pg.Undefined=new pg(void 0),pg);class $o{constructor(){this._first=qs.Undefined,this._last=qs.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===qs.Undefined}clear(){let e=this._first;for(;e!==qs.Undefined;){const t=e.next;e.prev=qs.Undefined,e.next=qs.Undefined,e=t}this._first=qs.Undefined,this._last=qs.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new qs(e);if(this._first===qs.Undefined)this._first=i,this._last=i;else if(t){const r=this._last;this._last=i,i.prev=r,r.next=i}else{const r=this._first;this._first=i,i.next=r,r.prev=i}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(i))}}shift(){if(this._first!==qs.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==qs.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==qs.Undefined&&e.next!==qs.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===qs.Undefined&&e.next===qs.Undefined?(this._first=qs.Undefined,this._last=qs.Undefined):e.next===qs.Undefined?(this._last=this._last.prev,this._last.next=qs.Undefined):e.prev===qs.Undefined&&(this._first=this._first.next,this._first.prev=qs.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==qs.Undefined;)yield e.element,e=e.next}}const d4="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function N4e(s=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of d4)s.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const bee=N4e();function Cee(s){let e=bee;if(s&&s instanceof RegExp)if(s.global)e=s;else{let t="g";s.ignoreCase&&(t+="i"),s.multiline&&(t+="m"),s.unicode&&(t+="u"),e=new RegExp(s.source,t)}return e.lastIndex=0,e}const Nve=new $o;Nve.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function CE(s,e,t,i,n){if(e=Cee(e),n||(n=hi.first(Nve)),t.length>n.maxLen){let d=s-n.maxLen/2;return d<0?d=0:i+=d,t=t.substring(d,s+n.maxLen/2),CE(s,e,t,i,n)}const r=Date.now(),o=s-1-i;let a=-1,l=null;for(let d=1;!(Date.now()-r>=n.timeBudget);d++){const h=o-n.windowSize*d;e.lastIndex=Math.max(0,h);const f=M4e(e,t,o,a);if(!f&&l||(l=f,h<=0))break;a=h}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 M4e(s,e,t,i){let n;for(;n=s.exec(e);){const r=n.index||0;if(r<=t&&s.lastIndex>=t)return n;if(i>0&&r>i)return null}return null}const mh=8;class Mve{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class Rve{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class kn{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return vV(e,t)}compute(e,t,i){return i}}class sI{constructor(e,t){this.newValue=e,this.didChange=t}}function vV(s,e){if(typeof s!="object"||typeof e!="object"||!s||!e)return new sI(e,s!==e);if(Array.isArray(s)||Array.isArray(e)){const i=Array.isArray(s)&&Array.isArray(e)&&Mn(s,e);return new sI(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const n=vV(s[i],e[i]);n.didChange&&(s[i]=n.newValue,t=!0)}return new sI(s,t)}class uN{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return vV(e,t)}validate(e){return this.defaultValue}}class Lx{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return vV(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function dt(s,e){return typeof s>"u"?e:s==="false"?!1:!!s}class bi extends Lx{constructor(e,t,i,n=void 0){typeof n<"u"&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return dt(e,this.defaultValue)}}function Vv(s,e,t,i){if(typeof s>"u")return e;let n=parseInt(s,10);return isNaN(n)?e:(n=Math.max(t,n),n=Math.min(i,n),n|0)}class sn extends Lx{static clampedInt(e,t,i,n){return Vv(e,t,i,n)}constructor(e,t,i,n,r,o=void 0){typeof o<"u"&&(o.type="integer",o.default=i,o.minimum=n,o.maximum=r),super(e,t,i,o),this.minimum=n,this.maximum=r}validate(e){return sn.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function R4e(s,e,t,i){if(typeof s>"u")return e;const n=zl.float(s,e);return zl.clamp(n,t,i)}class zl extends Lx{static clamp(e,t,i){return e<t?t:e>i?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,r){typeof r<"u"&&(r.type="number",r.default=i),super(e,t,i,r),this.validationFn=n}validate(e){return this.validationFn(zl.float(e,this.defaultValue))}}class Co extends Lx{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 Co.string(e,this.defaultValue)}}function Un(s,e,t,i){return typeof s!="string"?e:i&&s in i?i[s]:t.indexOf(s)===-1?e:s}class jn extends Lx{constructor(e,t,i,n,r=void 0){typeof r<"u"&&(r.type="string",r.enum=n,r.default=i),super(e,t,i,r),this._allowedValues=n}validate(e){return Un(e,this.defaultValue,this._allowedValues)}}class SA extends kn{constructor(e,t,i,n,r,o,a=void 0){typeof a<"u"&&(a.type="string",a.enum=r,a.default=n),super(e,t,i,a),this._allowedValues=r,this._convert=o}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function P4e(s){switch(s){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class O4e extends kn{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[w("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached."),w("accessibilitySupport.on","Optimize for usage with a Screen Reader."),w("accessibilitySupport.off","Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:w("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 A4e extends kn{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:w("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:w("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:dt(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:dt(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function F4e(s){switch(s){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var wr;(function(s){s[s.Line=1]="Line",s[s.Block=2]="Block",s[s.Underline=3]="Underline",s[s.LineThin=4]="LineThin",s[s.BlockOutline=5]="BlockOutline",s[s.UnderlineThin=6]="UnderlineThin"})(wr||(wr={}));function B4e(s){switch(s){case"line":return wr.Line;case"block":return wr.Block;case"underline":return wr.Underline;case"line-thin":return wr.LineThin;case"block-outline":return wr.BlockOutline;case"underline-thin":return wr.UnderlineThin}}class W4e extends uN{constructor(){super(143)}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(74)==="default"?n.push("mouse-default"):t.get(74)==="copy"&&n.push("mouse-copy"),t.get(112)&&n.push("showUnused"),t.get(141)&&n.push("showDeprecated"),n.join(" ")}}class V4e extends bi{constructor(){super(37,"emptySelectionClipboard",!0,{description:w("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class H4e extends kn{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:w("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:[w("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),w("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),w("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:w("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:[w("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),w("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),w("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:w("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:w("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:ii},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:w("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:w("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:dt(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":Un(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":Un(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:dt(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:dt(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:dt(t.loop,this.defaultValue.loop)}}}const jf=class jf extends kn{constructor(){super(51,"fontLigatures",jf.OFF,{anyOf:[{type:"boolean",description:w("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:w("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:w("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"||e.length===0?jf.OFF:e==="true"?jf.ON:e:e?jf.ON:jf.OFF}};jf.OFF='"liga" off, "calt" off',jf.ON='"liga" on, "calt" on';let e_=jf;const Uf=class Uf extends kn{constructor(){super(54,"fontVariations",Uf.OFF,{anyOf:[{type:"boolean",description:w("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:w("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:w("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"?Uf.OFF:e==="true"?Uf.TRANSLATE:e:e?Uf.TRANSLATE:Uf.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}};Uf.OFF="normal",Uf.TRANSLATE="translate";let yE=Uf;class $4e extends uN{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class z4e extends Lx{constructor(){super(52,"fontSize",Go.fontSize,{type:"number",minimum:6,maximum:100,default:Go.fontSize,description:w("fontSize","Controls the font size in pixels.")})}validate(e){const t=zl.float(e,this.defaultValue);return t===0?Go.fontSize:zl.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}const yh=class yh extends kn{constructor(){super(53,"fontWeight",Go.fontWeight,{anyOf:[{type:"number",minimum:yh.MINIMUM_VALUE,maximum:yh.MAXIMUM_VALUE,errorMessage:w("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:yh.SUGGESTION_VALUES}],default:Go.fontWeight,description:w("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(sn.clampedInt(e,Go.fontWeight,yh.MINIMUM_VALUE,yh.MAXIMUM_VALUE))}};yh.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],yh.MINIMUM_VALUE=1,yh.MAXIMUM_VALUE=1e3;let RU=yh;class j4e extends kn{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",multipleTests:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:"",alternativeTestsCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[w("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),w("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),w("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:w("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:w("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:w("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:w("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:w("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:w("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:w("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:w("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:w("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:w("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:w("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{multiple:Un(t.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:t.multipleDefinitions??Un(t.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:t.multipleTypeDefinitions??Un(t.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:t.multipleDeclarations??Un(t.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:t.multipleImplementations??Un(t.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:t.multipleReferences??Un(t.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),multipleTests:t.multipleTests??Un(t.multipleTests,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Co.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Co.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Co.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Co.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Co.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:Co.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}}class U4e extends kn{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:w("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:w("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:w("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:w("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:w("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:dt(t.enabled,this.defaultValue.enabled),delay:sn.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:dt(t.sticky,this.defaultValue.sticky),hidingDelay:sn.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:dt(t.above,this.defaultValue.above)}}}class $0 extends uN{constructor(){super(146)}compute(e,t,i){return $0.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 r=(i+e.viewLineCount+n)/(e.pixelRatio*e.height),o=Math.floor(e.viewLineCount/r);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:n,desiredRatio:r,minimapLineCount:o}}static _computeMinimapLayout(e,t){const i=e.outerWidth,n=e.outerHeight,r=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(r*n),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:n};const o=t.stableMinimapLayoutInput,a=o&&e.outerHeight===o.outerHeight&&e.lineHeight===o.lineHeight&&e.typicalHalfwidthCharacterWidth===o.typicalHalfwidthCharacterWidth&&e.pixelRatio===o.pixelRatio&&e.scrollBeyondLastLine===o.scrollBeyondLastLine&&e.paddingTop===o.paddingTop&&e.paddingBottom===o.paddingBottom&&e.minimap.enabled===o.minimap.enabled&&e.minimap.side===o.minimap.side&&e.minimap.size===o.minimap.size&&e.minimap.showSlider===o.minimap.showSlider&&e.minimap.renderCharacters===o.minimap.renderCharacters&&e.minimap.maxColumn===o.minimap.maxColumn&&e.minimap.scale===o.minimap.scale&&e.verticalScrollbarWidth===o.verticalScrollbarWidth&&e.isViewportWrapping===o.isViewportWrapping,l=e.lineHeight,d=e.typicalHalfwidthCharacterWidth,h=e.scrollBeyondLastLine,f=e.minimap.renderCharacters;let p=r>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const m=e.minimap.maxColumn,v=e.minimap.size,b=e.minimap.side,y=e.verticalScrollbarWidth,x=e.viewLineCount,D=e.remainingWidth,S=e.isViewportWrapping,I=f?2:3;let E=Math.floor(r*n);const R=E/r;let M=!1,O=!1,V=I*p,te=p/r,J=1;if(v==="fill"||v==="fit"){const{typicalViewportLineCount:Te,extraLinesBeforeFirstLine:Le,extraLinesBeyondLastLine:et,desiredRatio:Qe,minimapLineCount:kt}=$0.computeContainedMinimapLineCount({viewLineCount:x,scrollBeyondLastLine:h,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:n,lineHeight:l,pixelRatio:r});if(x/kt>1)M=!0,O=!0,p=1,V=1,te=p/r;else{let Tt=!1,Ft=p+1;if(v==="fit"){const ae=Math.ceil((Le+x+et)*V);S&&a&&D<=t.stableFitRemainingWidth?(Tt=!0,Ft=t.stableFitMaxMinimapScale):Tt=ae>E}if(v==="fill"||Tt){M=!0;const ae=p;V=Math.min(l*r,Math.max(1,Math.floor(1/Qe))),S&&a&&D<=t.stableFitRemainingWidth&&(Ft=t.stableFitMaxMinimapScale),p=Math.min(Ft,Math.max(1,Math.floor(V/I))),p>ae&&(J=Math.min(2,p/ae)),te=p/r/J,E=Math.ceil(Math.max(Te,Le+x+et)*V),S?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=D,t.stableFitMaxMinimapScale=p):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const z=Math.floor(m*te),H=Math.min(z,Math.max(0,Math.floor((D-y-2)*te/(d+te)))+mh);let G=Math.floor(r*H);const oe=G/r;G=Math.floor(G*J);const fe=f?1:2,we=b==="left"?0:i-H-y;return{renderMinimap:fe,minimapLeft:we,minimapWidth:H,minimapHeightIsEditorHeight:M,minimapIsSampling:O,minimapScale:p,minimapLineHeight:V,minimapCanvasInnerWidth:G,minimapCanvasInnerHeight:E,minimapCanvasOuterWidth:oe,minimapCanvasOuterHeight:R}}static computeLayout(e,t){const i=t.outerWidth|0,n=t.outerHeight|0,r=t.lineHeight|0,o=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,d=t.pixelRatio,h=t.viewLineCount,f=e.get(138),p=f==="inherit"?e.get(137):f,m=p==="inherit"?e.get(133):p,v=e.get(136),b=t.isDominatedByLongLines,y=e.get(57),x=e.get(68).renderType!==0,D=e.get(69),S=e.get(106),I=e.get(84),E=e.get(73),R=e.get(104),M=R.verticalScrollbarSize,O=R.verticalHasArrows,V=R.arrowSize,te=R.horizontalScrollbarSize,J=e.get(43),z=e.get(111)!=="never";let H=e.get(66);J&&z&&(H+=16);let G=0;if(x){const Ee=Math.max(o,D);G=Math.round(Ee*l)}let oe=0;y&&(oe=r*t.glyphMarginDecorationLaneCount);let fe=0,we=fe+oe,Te=we+G,Le=Te+H;const et=i-oe-G-H;let Qe=!1,kt=!1,ft=-1;p==="inherit"&&b?(Qe=!0,kt=!0):m==="on"||m==="bounded"?kt=!0:m==="wordWrapColumn"&&(ft=v);const Tt=$0._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:r,typicalHalfwidthCharacterWidth:a,pixelRatio:d,scrollBeyondLastLine:S,paddingTop:I.top,paddingBottom:I.bottom,minimap:E,verticalScrollbarWidth:M,viewLineCount:h,remainingWidth:et,isViewportWrapping:kt},t.memory||new Rve);Tt.renderMinimap!==0&&Tt.minimapLeft===0&&(fe+=Tt.minimapWidth,we+=Tt.minimapWidth,Te+=Tt.minimapWidth,Le+=Tt.minimapWidth);const Ft=et-Tt.minimapWidth,ae=Math.max(1,Math.floor((Ft-M-2)/a)),Ne=O?V:0;return kt&&(ft=Math.max(1,ae),m==="bounded"&&(ft=Math.min(ft,v))),{width:i,height:n,glyphMarginLeft:fe,glyphMarginWidth:oe,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:we,lineNumbersWidth:G,decorationsLeft:Te,decorationsWidth:H,contentLeft:Le,contentWidth:Ft,minimap:Tt,viewportColumn:ae,isWordWrapMinified:Qe,isViewportWrapping:kt,wrappingColumn:ft,verticalScrollbarWidth:M,horizontalScrollbarHeight:te,overviewRuler:{top:Ne,width:M,height:n-2*Ne,right:0}}}}class q4e extends kn{constructor(){super(140,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[w("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."),w("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:w("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 Un(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}var pd;(function(s){s.Off="off",s.OnCode="onCode",s.On="on"})(pd||(pd={}));class K4e extends kn{constructor(){const e={enabled:pd.OnCode};super(65,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",tags:["experimental"],enum:[pd.Off,pd.OnCode,pd.On],default:e.enabled,enumDescriptions:[w("editor.lightbulb.enabled.off","Disable the code action menu."),w("editor.lightbulb.enabled.onCode","Show the code action menu when the cursor is on lines with code."),w("editor.lightbulb.enabled.on","Show the code action menu when the cursor is on lines with code or on empty lines.")],description:w("enabled","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:Un(e.enabled,this.defaultValue.enabled,[pd.Off,pd.OnCode,pd.On])}}}class G4e extends kn{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(116,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:w("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor."),tags:["experimental"]},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:w("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:w("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:w("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:dt(t.enabled,this.defaultValue.enabled),maxLineCount:sn.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:Un(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:dt(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class Y4e extends kn{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(142,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:w("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[w("editor.inlayHints.on","Inlay hints are enabled"),w("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",ii?"Ctrl+Option":"Ctrl+Alt"),w("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",ii?"Ctrl+Option":"Ctrl+Alt"),w("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:w("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:w("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:w("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:Un(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:sn.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Co.string(t.fontFamily,this.defaultValue.fontFamily),padding:dt(t.padding,this.defaultValue.padding)}}}class Z4e extends kn{constructor(){super(66,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):sn.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?sn.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class X4e extends zl{constructor(){super(67,"lineHeight",Go.lineHeight,e=>zl.clamp(e,0,150),{markdownDescription:w("lineHeight",`Controls the line height.
|
|
203
|
+
`+r.substring(n),this.$nextTick(()=>{t.selectionStart=t.selectionEnd=i+1})}else s.preventDefault(),this.sendToPanel(e)},loadMore(){this.loadingMore=!0,this.page++;const s=this.sessions.slice(0,this.page*this.pageSize);this.displayedSessions=s,this.hasMore=this.sessions.length>s.length,this.loadingMore=!1},async createSession(){try{const s=await nve("新会话");this.sessions.unshift(s.data),this.page=1,this.displayedSessions=this.sessions.slice(0,this.pageSize),this.hasMore=this.sessions.length>this.pageSize,this.bindSessionToPanel(s.data)}catch(s){this.$message.error("创建会话失败: "+s.message)}},selectSession(s){this.currentSession=s,this.$route.params.id!==s.id&&this.$router.push({name:"codeView-session",params:{id:s.id}}).catch(()=>{}),this.bindSessionToPanel(s),this.loadDefaultModel(s)},async loadDefaultModel(s){var e,t;try{const i=await b2e("defaultModel");if((e=i.data)!=null&&e.value){const n=this.activeSessions[this.focusedPanelIndex];n&&((t=n.session)==null?void 0:t.id)===s.id&&(n.modelName=i.data.value)}}catch(i){console.error("加载默认模型失败:",i)}},async sendToPanel(s){const e=s.input.trim();if(!e||s.disabled)return;const t=S2e(s);s.input="",s.disabled=!0,s.stopping=!1,s.userQuestion=e;const i=this.snapPanelScroll(s),n=(s.mediaFiles||[]).filter(r=>!r.uploading&&r.filePath);this.pushLogItem(s,{type:"chat",content:t.message,mediaFiles:n.map(r=>({filePath:r.filePath,type:r.type,dataUrl:r.dataUrl}))}),this.$nextTick(()=>this.schedulePanelScroll(s,i)),Cd.send("chat",t),s.mediaFiles=[]},async _uploadFiles(s,e){console.log("[_uploadFiles] files:",s.length,"panel.mediaFiles count:",(e.mediaFiles||[]).length);const n=5-(e.mediaFiles||[]).length;if(n<=0){this.$message.warning("最多上传5张图片");return}const r=Math.min(s.length,n);e.mediaFiles||(e.mediaFiles=[]);for(let o=0;o<r;o++){const a=s[o],l=Date.now()+"_"+o+"_"+Math.random().toString(36).slice(2);e.mediaFiles.push({id:l,name:a.name||"paste.png",dataUrl:"",filePath:"",type:a.type||"image/png",uploading:!0})}for(let o=0;o<r;o++){const a=s[o],l=e.mediaFiles.length-r+o;try{const d=await x2e(a);e.mediaFiles[l].dataUrl=d.dataUrl,e.mediaFiles[l].filePath=d.filePath,e.mediaFiles[l].type=d.type,e.mediaFiles[l].uploading=!1}catch(d){this.$message.error("图片上传失败: "+d.message),e.mediaFiles.splice(l,1)}}},handleImageUpload(s){var n;console.log("[handleImageUpload] idx:",s,"activeSessions:",this.activeSessions.length);const e=this.activeSessions[s];if(!e){console.log("[handleImageUpload] panel is null/undefined");return}if(e.disabled){console.log("[handleImageUpload] panel.disabled=true");return}const t="imgInput-"+s,i=this.$refs[t];console.log("[handleImageUpload] refKey:",t,"inputEl:",i,"isArray:",Array.isArray(i)),i?Array.isArray(i)?(console.log("[handleImageUpload] clicking inputEl[0]"),(n=i[0])==null||n.click()):(console.log("[handleImageUpload] clicking inputEl directly"),i.click()):console.log("[handleImageUpload] inputEl not found! available refs:",Object.keys(this.$refs).filter(r=>r.startsWith("imgInput")))},async handleImageSelected(s,e){var n;console.log("[handleImageSelected] triggered, event.target.files length:",(n=s.target.files)==null?void 0:n.length);const t=s.target.files;if(!t||t.length===0){console.log("[handleImageSelected] no files selected");return}const i=Array.from(t);s.target.value="",console.log("[handleImageSelected] uploading",i.length,"files"),await this._uploadFiles(i,e)},async handlePasteImages(s,e){!e||e.disabled||await this._uploadFiles(s,e)},removeMedia(s,e){if(!s||!s.mediaFiles)return;const t=s.mediaFiles.findIndex(i=>i.id===e);t>-1&&s.mediaFiles.splice(t,1)},openImagePreview(s){this.previewImage=s},closeImagePreview(){this.previewImage=null},onKeydown(s){s.key==="Escape"&&this.previewImage&&this.closeImagePreview()},stopPanel(s){var e;!((e=s.session)!=null&&e.id)||s.stopping||(s.stopping=!0,Cd.send("stop",{sessionId:s.session.id}))},async handleSessionCommand(s,e){s==="rename"?this.$prompt("请输入新名称","重命名会话",{confirmButtonText:"确定",cancelButtonText:"取消",inputValue:e.title||"新会话",inputPattern:/.+/,inputErrorMessage:"名称不能为空"}).then(async({value:t})=>{var i;try{await _2e(e.id,{title:t}),e.title=t,((i=this.currentSession)==null?void 0:i.id)===e.id&&(this.currentSession.title=t),this.$message.success("重命名成功")}catch(n){this.$message.error("重命名失败: "+n.message)}}).catch(()=>{}):s==="delete"&&this.$confirm("确定要删除该会话吗?此操作会同时删除会话中的所有消息。","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(async()=>{var t;try{await v2e(e.id);const i=this.sessions.findIndex(r=>r.id===e.id);i>-1&&this.sessions.splice(i,1);const n=this.displayedSessions.findIndex(r=>r.id===e.id);n>-1&&this.displayedSessions.splice(n,1),((t=this.currentSession)==null?void 0:t.id)===e.id&&(this.currentSession=this.displayedSessions.length>0?this.displayedSessions[0]:null),this.$message.success("删除成功")}catch(i){this.$message.error("删除失败: "+i.message)}}).catch(()=>{})}}};var SFe=function(){var i,n;var e=this,t=e._self._c;return t("div",{staticClass:"code-view"},[e.sidebarVisible?t("SessionsPanel",{attrs:{sessions:e.displayedSessions,"current-session-id":(i=e.currentSession)==null?void 0:i.id,"has-more":e.hasMore,"loading-more":e.loadingMore},on:{create:e.createSession,select:e.selectSession,command:e.handleSessionCommand,dragstart:e.onDragStart,loadmore:e.loadMore}}):e._e(),t("div",{staticClass:"terminal-container",class:"layout-"+e.layoutMode},e._l(e.activeSessions,function(r,o){var a,l,d,h,f,p;return t("div",{key:o,staticClass:"session-panel",class:{"panel-active":e.focusedPanelIndex===o},on:{click:function(m){e.focusedPanelIndex=o},dragover:function(m){m.preventDefault()},drop:function(m){return e.onDropPanel(m,o)}}},[t("div",{staticClass:"panel-header"},[t("span",{staticClass:"title"},[e._v("# "+e._s((a=r.session)!=null&&a.id?e.getTitleText(r.userQuestion,"新会话"):"选择会话"))])]),t("div",{staticClass:"log-area"},[(l=r.session)!=null&&l.id?[e._l(r.logItems,function(m,v){return[m.type==="todos"?t("div",{staticClass:"todos-list"},e._l(m.todos,function(b,y){return t("div",{key:`${m._id||v}-todo-${y}`,staticClass:"todo-item"},[t("span",{staticClass:"todo-status"},[e._v(e._s(e.getTodoStatusIcon(b.status)))]),t("span",{staticClass:"todo-name"},[e._v(e._s(b.name))])])}),0):m.type==="chat"?t("div",{staticClass:"flex justify-end"},[t("div",{staticClass:"user-question"},[m.mediaFiles&&m.mediaFiles.length>0?t("div",{staticClass:"chat-images"},e._l(m.mediaFiles,function(b){return t("img",{key:b.filePath,staticClass:"chat-image-thumb",attrs:{src:b.url||b.dataUrl||b.filePath},on:{click:function(y){return y.stopPropagation(),e.openImagePreview(b)}}})}),0):e._e(),t("div",[e._v(e._s(m.content))])])]):m.type==="think"?t("p",{domProps:{innerHTML:e._s(m.renderedContent||e.renderMarkdown(m.content))}}):m.type==="step"?[m.thought?t("p",{domProps:{innerHTML:e._s(m.renderedThought||e.renderMarkdown(m.thought))}}):e._e(),e._l(m.toolCalls,function(b,y){return t("div",{key:`${m._id||v}-tool-${y}`,staticClass:"log-mute"},[t("span",{class:m.success!==!1?"tool-success":"tool-fail"},[e._v(" "+e._s(m.success!==!1?"✓":"✗")+" ")]),e._v(" "+e._s(e.getToolCallName(b))+" "),e.getToolCallArguments(b)?t("span",{staticClass:"tool-input"},[e._v(e._s(e.formatInput(e.getToolCallName(b),e.getToolCallArguments(b))))]):e._e()])})]:e._e()]}),r.logItems.length===0?t("div",{staticClass:"empty-state"},[t("span",[e._v("开始对话吧!输入您的问题...")])]):e._e(),r.modelName?t("div",{staticClass:"build-info"},[t("span",{staticClass:"icon"},[e._v("▣")]),e._v(" Build · "+e._s(r.modelName)+" ")]):e._e()]:t("div",{staticClass:"empty-state"},[t("span",[e._v("拖拽会话到此处或点击选择")])])],2),t("div",{staticClass:"input-block"},[r.mediaFiles&&r.mediaFiles.length>0?t("ImagePreviewList",{attrs:{files:r.mediaFiles,disabled:r.disabled},on:{remove:m=>e.removeMedia(r,m)}}):e._e(),t("div",{staticClass:"input-wrapper"},[t("ResizableTextarea",{staticClass:"input-area",attrs:{rows:5,placeholder:"输入消息... (Enter 发送, Ctrl+Enter 换行, @ 选择文件)",disabled:r.disabled||!((d=r.session)!=null&&d.id)},on:{input:function(m){return e.onInputChange(m,r)},"paste-image":function(m){return e.handlePasteImages(m,r)}},nativeOn:{keydown:[function(m){return!m.type.indexOf("key")&&e._k(m.keyCode,"enter",13,m.key,"Enter")?null:e.handleKeydown(m,r)},function(m){return!m.type.indexOf("key")&&e._k(m.keyCode,"esc",27,m.key,["Esc","Escape"])?null:e.cancelFileSelect.apply(null,arguments)}]},model:{value:r.input,callback:function(m){e.$set(r,"input",m)},expression:"panel.input"}}),t("input",{ref:"imgInput-"+o,refInFor:!0,staticStyle:{display:"none"},attrs:{type:"file",accept:"image/*",multiple:""},on:{change:m=>e.handleImageSelected(m,r)}}),t("div",{staticClass:"input-actions"},[t("el-button",{staticClass:"upload-btn",attrs:{disabled:r.disabled||!((h=r.session)!=null&&h.id),size:"small"},on:{click:function(m){return e.handleImageUpload(o)}}},[e._v(" 图片 ")]),r.disabled&&!r.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"danger",size:"small"},on:{click:function(m){return m.stopPropagation(),e.stopPanel(r)}}},[e._v(" ■ 停止 ")]):r.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"info",disabled:"",size:"small"}},[e._v(" 停止中... ")]):t("el-button",{staticClass:"send-btn",attrs:{type:"primary",disabled:!((f=r.session)!=null&&f.id),size:"small"},on:{click:function(m){return m.stopPropagation(),e.sendToPanel(r)}}},[e._v(" 发送 ")])],1)],1)],1),t("div",{staticClass:"status-bar"},[r.sessionStatus==="processing"||r.disabled&&!r.stopping?t("span",{staticClass:"status-thinking"},[t("span",{staticClass:"thinking-spinner",attrs:{"aria-hidden":"true"}}),e._v(" 思考中 ")]):t("span",{staticClass:"status-ready"},[e._v("✓ 就绪")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"model-selector",on:{click:function(m){return m.stopPropagation(),e.openModelSelector(r)}}},[e._v(" 模型:"+e._s(r.modelName||"-")+" ▾ ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("会话:"+e._s((p=r.session)!=null&&p.id?r.session.id.slice(0,8):"--------"))]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("token:("),t("span",{class:r.promptTokens>5e4?"token-warning":""},[e._v(e._s(r.promptTokens||0)+e._s(r.promptTokens>5e4?" 会话太大推荐用/compact压缩会话":""))]),e._v(")")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:function(m){return m.stopPropagation(),e.openCommandDialog.apply(null,arguments)}}},[e._v("命令")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:function(m){return m.stopPropagation(),e.openFileSelectFromStatus.apply(null,arguments)}}},[e._v("选择文件")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:function(m){return m.stopPropagation(),e.openSkillSelectFromStatus.apply(null,arguments)}}},[e._v("选择Skill")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:function(m){return m.stopPropagation(),e.toggleChatMode(r)}}},[e._v(" 模式:"+e._s(r.chatMode==="plan"?"计划":"编码")+" ▾ ")])])])}),0),t("div",{staticClass:"layout-switcher"},[t("el-button-group",[t("el-button",{attrs:{type:e.layoutMode===1?"primary":""},on:{click:function(r){return e.setLayout(1)}}},[e._v("1")]),t("el-button",{attrs:{type:e.layoutMode===2?"primary":""},on:{click:function(r){return e.setLayout(2)}}},[e._v("2")]),t("el-button",{attrs:{type:e.layoutMode===4?"primary":""},on:{click:function(r){return e.setLayout(4)}}},[e._v("4")])],1)],1),t("FileSelectDialog",{attrs:{visible:e.fileSelectVisible},on:{"update:visible":function(r){e.fileSelectVisible=r},select:e.onFileSelected,close:e.cancelFileSelect}}),t("SkillSelectDialog",{attrs:{visible:e.skillSelectVisible},on:{"update:visible":function(r){e.skillSelectVisible=r},select:e.onSkillSelected,close:e.cancelSkillSelect}}),t("ModelSelectDialog",{attrs:{visible:e.modelSelectVisible,"current-model":(n=e.selectedPanel)==null?void 0:n.modelName},on:{"update:visible":function(r){e.modelSelectVisible=r},select:e.onModelSelected,close:function(r){e.modelSelectVisible=!1}}}),t("CommandDialog",{attrs:{visible:e.commandDialogVisible},on:{"update:visible":function(r){e.commandDialogVisible=r},execute:e.handleExecuteCommand,close:function(r){e.commandDialogVisible=!1}}}),e.previewImage?t("div",{staticClass:"image-lightbox",on:{click:e.closeImagePreview}},[t("span",{staticClass:"lightbox-close",on:{click:e.closeImagePreview}},[e._v("×")]),t("img",{staticClass:"lightbox-image",attrs:{src:e.previewImage.url||e.previewImage.dataUrl||e.previewImage.filePath},on:{click:function(r){r.stopPropagation()}}})]):e._e()],1)},xFe=[],kFe=en(wFe,SFe,xFe,!1,null,"118377a2");const rce=kFe.exports,LFe={name:"ProviderList",props:{providers:{type:Array,default:()=>[]},models:{type:Array,default:()=>[]},songbingProvider:{type:Object,default:null}},emits:["add-provider","edit-provider","delete-provider","add-model","edit-model","delete-model","export-config","import-config","auth-songbing","sync-songbing-models","cancel-songbing-auth"],data(){return{expandedProviders:[]}},computed:{nonOfficialProviders(){return this.providers.filter(s=>s.name!=="自建AI平台")},songbingModels(){return this.songbingProvider?this.models.filter(s=>s.providerId===this.songbingProvider.id):[]},songbingBaseUrl(){var s;return((s=this.songbingProvider)==null?void 0:s.baseUrl)||""},songbingPlatformUrl(){return this.songbingBaseUrl.replace(/\/api\/v1$/,"")}},methods:{toggleProvider(s){const e=this.expandedProviders.indexOf(s);e>-1?this.expandedProviders.splice(e,1):this.expandedProviders.push(s)},getModelsByProvider(s){return this.models.filter(e=>e.providerId===s)}}};var DFe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"provider-list"},[t("div",{staticClass:"flex justify-between items-center mb-4"},[t("h3",{staticClass:"text-xl text-white"},[e._v("AI 服务商 & 模型")]),t("div",{staticClass:"flex gap-2"},[t("el-button",{attrs:{size:"small"},on:{click:function(i){return e.$emit("export-config")}}},[t("i",{staticClass:"fa-solid fa-download mr-1"}),e._v("导出配置 ")]),t("el-button",{attrs:{size:"small"},on:{click:function(i){return e.$emit("import-config")}}},[t("i",{staticClass:"fa-solid fa-upload mr-1"}),e._v("导入配置 ")]),t("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(i){return e.$emit("add-provider")}}},[e._v("+ 添加服务商")])],1)]),t("div",{staticClass:"providers"},[t("div",{staticClass:"provider-item official-provider"},[t("div",{staticClass:"provider-main",on:{click:function(i){return e.toggleProvider("songbing-official")}}},[t("span",{staticClass:"expand-icon",class:{expanded:e.expandedProviders.includes("songbing-official")}},[e._v("▶")]),t("div",{staticClass:"provider-logo official-logo"},[e._v("S")]),t("div",{staticClass:"provider-info"},[t("div",{staticClass:"provider-name"},[e._v(" 自建AI平台 "),e.songbingProvider?t("el-tag",{attrs:{type:"success",size:"mini"}},[e._v("已认证")]):e._e()],1),t("div",{staticClass:"provider-url"},[e._v(e._s(e.songbingPlatformUrl))])]),t("div",{staticClass:"provider-actions"},[t("el-button",{attrs:{type:"warning",size:"small"},on:{click:function(i){return i.stopPropagation(),e.$emit("auth-songbing")}}},[e._v(" "+e._s(e.songbingProvider?"重新认证":"认证")+" ")]),t("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(i){return i.stopPropagation(),e.$emit("sync-songbing-models")}}},[e._v(" 同步模型 ")]),e.songbingProvider?t("el-button",{attrs:{type:"danger",size:"small"},on:{click:function(i){return i.stopPropagation(),e.$emit("cancel-songbing-auth")}}},[e._v(" 取消认证 ")]):e._e()],1)]),t("div",{staticClass:"models-panel",class:{expanded:e.expandedProviders.includes("songbing-official")}},[e._l(e.songbingModels,function(i){return t("div",{key:i.id,staticClass:"model-item"},[t("span",{staticClass:"model-name"},[e._v(e._s(i.name))]),i.enabled?t("el-tag",{attrs:{type:"success",size:"mini"}},[e._v("启用")]):t("el-tag",{attrs:{type:"info",size:"mini"}},[e._v("禁用")])],1)}),e.songbingModels.length===0?t("div",{staticClass:"empty-models"},[e._v(" 暂无模型,请先认证后同步 ")]):e._e()],2)]),e._l(e.nonOfficialProviders,function(i){return t("div",{key:i.id,staticClass:"provider-item"},[t("div",{staticClass:"provider-main",on:{click:function(n){return e.toggleProvider(i.id)}}},[t("span",{staticClass:"expand-icon",class:{expanded:e.expandedProviders.includes(i.id)}},[e._v("▶")]),t("div",{staticClass:"provider-logo"},[e._v(e._s(i.name.charAt(0).toUpperCase()))]),t("div",{staticClass:"provider-info"},[t("div",{staticClass:"provider-name"},[e._v(" "+e._s(i.name)+" "),i.isDefault?t("el-tag",{attrs:{type:"success",size:"mini"}},[e._v("默认")]):e._e()],1),t("div",{staticClass:"provider-url"},[e._v(e._s(i.baseUrl))])]),t("div",{staticClass:"provider-actions"},[t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(n){return n.stopPropagation(),e.$emit("edit-provider",i)}}},[e._v("修改")]),t("el-button",{staticClass:"delete-btn",attrs:{type:"text",size:"small"},on:{click:function(n){return n.stopPropagation(),e.$emit("delete-provider",i.id)}}},[e._v("删除")])],1)]),t("div",{staticClass:"models-panel",class:{expanded:e.expandedProviders.includes(i.id)}},[t("div",{staticClass:"models-header"},[t("span",{staticClass:"models-title"},[e._v("模型列表")]),t("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(n){return n.stopPropagation(),e.$emit("add-model",i.id)}}},[e._v("+ 添加模型")])],1),e._l(e.getModelsByProvider(i.id),function(n){return t("div",{key:n.id,staticClass:"model-item"},[t("span",{staticClass:"model-name"},[e._v(e._s(n.name))]),n.enabled?t("el-tag",{attrs:{type:"success",size:"mini"}},[e._v("启用")]):t("el-tag",{attrs:{type:"info",size:"mini"}},[e._v("禁用")]),t("div",{staticClass:"model-actions"},[t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(r){return r.stopPropagation(),e.$emit("edit-model",n)}}},[e._v("修改")]),t("el-button",{staticClass:"delete-btn",attrs:{type:"text",size:"small"},on:{click:function(r){return r.stopPropagation(),e.$emit("delete-model",n.id)}}},[e._v("删除")])],1)],1)}),e.getModelsByProvider(i.id).length===0?t("div",{staticClass:"empty-models"},[e._v(" 暂无模型 ")]):e._e()],2)])}),e.nonOfficialProviders.length===0?t("div",{staticClass:"empty"},[e._v(" 暂无服务商 ")]):e._e()],2)])},IFe=[],EFe=en(LFe,DFe,IFe,!1,null,"df73201c");const TFe=EFe.exports,NFe={name:"ProviderDialog",props:{visible:{type:Boolean,default:!1},editingProvider:{type:Object,default:null}},data(){return{selectedPreset:"",originalApiKey:"",presets:[{name:"openai",label:"OpenAI",nameValue:"OpenAI",baseUrlValue:"https://api.openai.com/v1"},{name:"deepseek",label:"DeepSeek",nameValue:"DeepSeek",baseUrlValue:"https://api.deepseek.com/v1"},{name:"minimax",label:"MiniMax",nameValue:"MiniMax",baseUrlValue:"https://api.minimax.io/v1"},{name:"zlm",label:"ZLM",nameValue:"ZLM",baseUrlValue:"https://open.bigmodel.cn/api/paas/v4/"},{name:"qwen",label:"Qwen",nameValue:"Qwen",baseUrlValue:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1"},{name:"xiaomi_mimo",label:"Xiaomi Mimo",nameValue:"Xiaomi Mimo",baseUrlValue:"https://api.xiaomimimo.com/v1"},{name:"openrouter",label:"OpenRouter",nameValue:"OpenRouter",baseUrlValue:"https://openrouter.ai/api/v1"},{name:"custom",label:"自定义",nameValue:"",baseUrlValue:""}],form:{name:"",apiKey:"",baseUrl:""},rules:{name:[{required:!0,message:"请输入名称",trigger:"blur"}],apiKey:[{required:!0,message:"请输入 API Key",trigger:"blur"}]}}},watch:{visible(s){s&&this.editingProvider?this.loadProviderDetail():s&&(this.selectedPreset="",this.originalApiKey="",this.form={name:"",apiKey:"",baseUrl:""})}},methods:{async loadProviderDetail(){var s;try{const e=await this.$api.getProvider(this.editingProvider.id);this.originalApiKey=((s=e.data)==null?void 0:s.apiKey)||"",this.form={name:this.editingProvider.name,apiKey:this.originalApiKey,baseUrl:this.editingProvider.baseUrl||""}}catch{this.form={name:this.editingProvider.name,apiKey:"",baseUrl:this.editingProvider.baseUrl||""}}},onPresetChange(s){const e=this.presets.find(t=>t.name===s);e&&(this.form.name=e.nameValue,this.form.baseUrl=e.baseUrlValue)},handleClose(){var s;(s=this.$refs.formRef)==null||s.resetFields(),this.selectedPreset="",this.originalApiKey="",this.$emit("update:visible",!1),this.$emit("close")},async handleSubmit(){try{await this.$refs.formRef.validate()}catch{return}try{if(this.editingProvider){const s={name:this.form.name,baseUrl:this.form.baseUrl};this.form.apiKey&&this.form.apiKey!==this.originalApiKey&&(s.apiKey=this.form.apiKey),await this.$api.updateProvider(this.editingProvider.id,s),this.$message.success("更新成功")}else await this.$api.addProvider(this.form),this.$message.success("添加成功");this.$emit("success"),this.handleClose()}catch(s){this.$message.error("保存失败: "+s.message)}}}};var MFe=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.editingProvider?"编辑服务商":"添加服务商",visible:e.visible,width:"500px"},on:{"update:visible":function(i){e.visible=i},close:e.handleClose}},[t("el-form",{ref:"formRef",attrs:{model:e.form,rules:e.rules,"label-width":"100px"}},[e.editingProvider?e._e():t("el-form-item",{attrs:{label:"预设模板"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"选择预设或自定义"},on:{change:e.onPresetChange},model:{value:e.selectedPreset,callback:function(i){e.selectedPreset=i},expression:"selectedPreset"}},e._l(e.presets,function(i){return t("el-option",{key:i.name,attrs:{label:i.label,value:i.name}})}),1)],1),t("el-form-item",{attrs:{label:"名称",prop:"name"}},[t("el-input",{attrs:{placeholder:"例如: OpenAI"},model:{value:e.form.name,callback:function(i){e.$set(e.form,"name",i)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"API Key",prop:"apiKey"}},[t("el-input",{attrs:{placeholder:e.editingProvider?"留空则不修改":"sk-..."},model:{value:e.form.apiKey,callback:function(i){e.$set(e.form,"apiKey",i)},expression:"form.apiKey"}}),e.editingProvider&&e.originalApiKey?t("div",{staticClass:"form-tip"},[e._v("当前已设置 API Key")]):e._e()],1),t("el-form-item",{attrs:{label:"Base URL",prop:"baseUrl"}},[t("el-input",{attrs:{placeholder:"https://api.openai.com/v1"},model:{value:e.form.baseUrl,callback:function(i){e.$set(e.form,"baseUrl",i)},expression:"form.baseUrl"}})],1)],1),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.handleClose}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleSubmit}},[e._v("保存")])],1)],1)},RFe=[],PFe=en(NFe,MFe,RFe,!1,null,"1529f1f1");const OFe=PFe.exports,AFe={name:"ModelDialog",props:{visible:{type:Boolean,default:!1},editingModel:{type:Object,default:null},providers:{type:Array,default:()=>[]},defaultProviderId:{type:String,default:""}},data(){return{form:{providerId:"",name:"",enabled:!0},rules:{providerId:[{required:!0,message:"请选择服务商",trigger:"blur"}],name:[{required:!0,message:"请输入模型名称",trigger:"blur"}]}}},watch:{visible(s){s&&(this.editingModel?this.form={providerId:this.editingModel.providerId,name:this.editingModel.name,enabled:this.editingModel.enabled}:this.form={providerId:this.defaultProviderId||"",name:"",enabled:!0})}},methods:{handleClose(){var s;(s=this.$refs.formRef)==null||s.resetFields(),this.$emit("update:visible",!1),this.$emit("close")},async handleSubmit(){try{await this.$refs.formRef.validate()}catch{return}try{this.editingModel?(await this.$api.updateModel(this.editingModel.id,{name:this.form.name,enabled:this.form.enabled}),this.$message.success("更新成功")):(await this.$api.addModel(this.form),this.$message.success("添加成功")),this.$emit("success"),this.handleClose()}catch(s){this.$message.error("保存失败: "+s.message)}}}};var FFe=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.editingModel?"编辑模型":"添加模型",visible:e.visible,width:"500px"},on:{"update:visible":function(i){e.visible=i},close:e.handleClose}},[t("el-form",{ref:"formRef",attrs:{model:e.form,rules:e.rules,"label-width":"100px"}},[e.editingModel?e._e():t("el-form-item",{attrs:{label:"所属服务商",prop:"providerId"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"选择服务商"},model:{value:e.form.providerId,callback:function(i){e.$set(e.form,"providerId",i)},expression:"form.providerId"}},e._l(e.providers,function(i){return t("el-option",{key:i.id,attrs:{label:i.name,value:i.id}})}),1)],1),t("el-form-item",{attrs:{label:"模型名称",prop:"name"}},[t("el-input",{attrs:{placeholder:"例如: GPT-4"},model:{value:e.form.name,callback:function(i){e.$set(e.form,"name",i)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"启用"}},[t("el-switch",{model:{value:e.form.enabled,callback:function(i){e.$set(e.form,"enabled",i)},expression:"form.enabled"}})],1)],1),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.handleClose}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleSubmit}},[e._v("保存")])],1)],1)},BFe=[],WFe=en(AFe,FFe,BFe,!1,null,"879e8810");const VFe=WFe.exports,HFe={name:"SkillsList",props:{skills:{type:Array,default:()=>[]}}};var $Fe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"skills-list"},[t("div",{staticClass:"list"},[e._l(e.skills,function(i){return t("div",{key:i.id||i.name,staticClass:"skill-item"},[t("div",{staticClass:"skill-info"},[t("div",{staticClass:"skill-name"},[e._v(e._s(i.name))]),t("div",{staticClass:"skill-desc"},[e._v(e._s(i.description||"暂无描述"))])]),t("el-tag",{attrs:{type:i.enabled?"success":"info",size:"mini"}},[e._v(" "+e._s(i.enabled?"启用":"禁用")+" ")])],1)}),e.skills.length===0?t("div",{staticClass:"empty"},[e._v(" 暂无技能 ")]):e._e()],2)])},zFe=[],jFe=en(HFe,$Fe,zFe,!1,null,"8fde7d06");const UFe=jFe.exports,qFe={name:"Settings",components:{ProviderList:TFe,ProviderDialog:OFe,ModelDialog:VFe,SkillsList:UFe},data(){return{activeTab:"providers",tabs:[{name:"providers",label:"AI 服务商",icon:"fa-solid fa-server"},{name:"advanced",label:"高级",icon:"fa-solid fa-gear"},{name:"proxy",label:"代理设置",icon:"fa-solid fa-globe"},{name:"gateway",label:"网关",icon:"fa-solid fa-plug"},{name:"email",label:"邮件配置",icon:"fa-solid fa-envelope"}],providers:[],models:[],skills:[],defaultProviderId:null,config:{maxToolIterations:10,maxSessionCompression:5,webPort:4e4},proxyConfig:{enabled:!1,type:"http",host:"",port:1080},gateway:{enabled:!1,clientId:"",clientSecret:""},gatewayStatus:{running:!1,configured:!1},gatewayLoading:!1,showProviderDialog:!1,editingProvider:null,showModelDialog:!1,editingModel:null,emailConfig:{host:"",port:587,secure:!1,user:"",password:"",fromName:""},emailStatus:{valid:null},emailLoading:!1,wafGateway:{serverIp:"",secretKey:""},wafStatus:{status:"stopped",configured:!1},wafGatewayLoading:!1,songbingConfig:{platformUrl:"",apiBaseUrl:""},songbingProvider:null,pollTimer:null,showAuthDialog:!1,authForm:{platformUrl:""},authLoading:!1}},created(){this.loadProviders(),this.loadModels(),this.loadSkills(),this.loadConfig(),this.loadProxyConfig(),this.loadGatewayConfig(),this.loadGatewayStatus(),this.loadSongbingConfig()},activated(){this.activeTab==="gateway"&&(this.loadGatewayConfig(),this.loadGatewayStatus())},watch:{activeTab(s){s==="gateway"?(this.loadGatewayConfig(),this.loadGatewayStatus(),this.loadWafConfig(),this.loadWafStatus()):s==="proxy"?this.loadProxyConfig():s==="email"&&this.loadEmailConfig()}},methods:{async loadProxyConfig(){try{const s=await this.$api.getProxyConfig();s.data&&(this.proxyConfig={enabled:s.data.enabled||!1,type:s.data.type||"http",host:s.data.host||"",port:s.data.port||1080})}catch{}},async saveProxyConfig(){try{await this.$api.updateProxyConfig(this.proxyConfig),this.$message.success("代理配置已保存")}catch(s){this.$message.error("保存失败: "+s.message)}},openProviderDialog(s){this.editingProvider=s,this.showProviderDialog=!0},openModelDialog(s,e){this.editingModel=e,this.showModelDialog=!0},async loadProviders(){try{const s=await this.$api.getProviders();this.providers=s.data||[];const e=this.providers.find(t=>t.isDefault);this.defaultProviderId=(e==null?void 0:e.id)||null,this.checkSongbingProvider()}catch(s){this.$message.error("加载提供商失败: "+s.message)}},async loadModels(){try{const s=await this.$api.getModels();this.models=s.data||[]}catch(s){this.$message.error("加载模型失败: "+s.message)}},async loadSkills(){try{const s=await this.$api.getSkills();this.skills=s.data||[]}catch{this.skills=[]}},async loadConfig(){var s;try{const e=await this.$api.getConfig("ai.maxToolIterations");(s=e.data)!=null&&s.value&&(this.config.maxToolIterations=parseInt(e.data.value))}catch{}},async deleteProvider(s){try{await this.$confirm("确定要删除该服务商吗?","提示",{type:"warning"}),await this.$api.deleteProvider(s),this.$message.success("删除成功"),await this.loadProviders()}catch(e){e!=="cancel"&&this.$message.error("删除失败: "+e.message)}},async deleteModel(s){try{await this.$confirm("确定要删除该模型吗?","提示",{type:"warning"}),await this.$api.deleteModel(s),this.$message.success("删除成功"),await this.loadModels()}catch(e){e!=="cancel"&&this.$message.error("删除失败: "+e.message)}},async saveConfig(s,e){try{await this.$api.setConfig(s,e),this.$message.success("配置已保存")}catch(t){this.$message.error("保存失败: "+t.message)}},async loadGatewayConfig(){try{const s=await this.$api.getDingtalkConfig();s.data&&(this.gateway={enabled:s.data.enabled||!1,clientId:s.data.clientId||"",clientSecret:s.data.clientSecret||""})}catch(s){console.error("Failed to load gateway config:",s)}},async loadGatewayStatus(){try{const s=await this.$api.getGatewayStatus();s.data&&(this.gatewayStatus={running:s.data.running||!1,configured:s.data.configured||!1})}catch(s){console.error("Failed to load gateway status:",s)}},async saveGatewayConfig(){try{await this.$api.updateDingtalkConfig(this.gateway),this.$message.success("网关配置已保存"),this.loadGatewayStatus()}catch(s){this.$message.error("保存失败: "+s.message)}},async toggleGateway(){this.gatewayLoading=!0;try{if(this.gatewayStatus.running)await this.$api.stopDingtalk(),this.$message.success("网关已停止");else{if(!this.gateway.clientId||!this.gateway.clientSecret){this.$message.error("请先配置 Client ID 和 Client Secret"),this.gatewayLoading=!1;return}await this.$api.updateDingtalkConfig(this.gateway),await this.$api.startDingtalk(),this.$message.success("网关已启动")}await this.loadGatewayStatus()}catch(s){this.$message.error("操作失败: "+s.message)}finally{this.gatewayLoading=!1}},async loadWafConfig(){try{const s=await this.$api.getWafConfig();s.data&&(this.wafGateway={serverIp:s.data.server_ip||"",secretKey:s.data.secret_key||""})}catch(s){console.error("Failed to load WAF config:",s)}},async loadWafStatus(){try{const s=await this.$api.getWafStatus();s.data&&(this.wafStatus={status:s.data.status||"stopped",configured:s.data.configured||!1})}catch(s){console.error("Failed to load WAF status:",s)}},async saveWafConfig(){try{await this.$api.updateWafConfig({server_ip:this.wafGateway.serverIp,secret_key:this.wafGateway.secretKey}),this.$message.success("WAF网关配置已保存"),this.loadWafStatus()}catch(s){this.$message.error("保存失败: "+s.message)}},async toggleWafGateway(){this.wafGatewayLoading=!0;try{if(this.wafStatus.status==="running")await this.$api.stopWaf(),this.$message.success("WAF网关已停止");else{if(!this.wafGateway.serverIp||!this.wafGateway.secretKey){this.$message.error("请先配置服务器IP和秘钥"),this.wafGatewayLoading=!1;return}await this.$api.updateWafConfig({server_ip:this.wafGateway.serverIp,secret_key:this.wafGateway.secretKey}),await this.$api.startWaf(),this.$message.success("WAF网关已启动")}await this.loadWafStatus()}catch(s){this.$message.error("操作失败: "+s.message)}finally{this.wafGatewayLoading=!1}},async loadEmailConfig(){try{const e=(await this.$api.getEmailConfigs()).data||[];if(e.length>0){const t=e[0];this.emailConfig={host:t.host||"",port:t.port||587,secure:!!t.secure,user:t.user||"",password:t.password||"",fromName:t.from_name||""},this.emailStatus.valid=null}else this.emailConfig={host:"",port:587,secure:!1,user:"",password:"",fromName:""},this.emailStatus.valid=null}catch(s){this.$message.error("加载邮件配置失败: "+s.message)}},async saveEmailConfig(){try{const e=((await this.$api.getEmailConfigs()).data||[])[0];e?await this.$api.updateEmailConfig(e.id,{host:this.emailConfig.host,port:this.emailConfig.port,secure:this.emailConfig.secure,user:this.emailConfig.user,password:this.emailConfig.password,from_name:this.emailConfig.fromName}):await this.$api.createEmailConfig({host:this.emailConfig.host,port:this.emailConfig.port,secure:this.emailConfig.secure,user:this.emailConfig.user,password:this.emailConfig.password,from_name:this.emailConfig.fromName,is_default:!0}),this.$message.success("配置已保存")}catch(s){this.$message.error("保存失败: "+s.message)}},async testEmailConfig(){try{const e=((await this.$api.getEmailConfigs()).data||[])[0];if(!e){this.$message.error("请先保存配置后再测试");return}this.emailLoading=!0;const t=await this.$api.validateEmailConfig(e.id);t.success?(this.$message.success("连接测试成功"),this.emailStatus.valid=!0):(this.$message.error("连接测试失败: "+t.error),this.emailStatus.valid=!1)}catch(s){this.$message.error("测试失败: "+s.message),this.emailStatus.valid=!1}finally{this.emailLoading=!1}},async handleExportConfig(){try{const s=await this.$api.exportConfig(),e=new Date,i=`config_${e.getFullYear().toString()+(e.getMonth()+1).toString().padStart(2,"0")+e.getDate().toString().padStart(2,"0")+"_"+e.getHours().toString().padStart(2,"0")+e.getMinutes().toString().padStart(2,"0")+e.getSeconds().toString().padStart(2,"0")}.yml`,n=window.URL.createObjectURL(s),r=document.createElement("a");r.href=n,r.download=i,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(n),this.$message.success("配置导出成功")}catch(s){this.$message.error("导出失败: "+s.message)}},handleImportConfig(){const s=document.createElement("input");s.type="file",s.accept=".yml,.yaml",s.onchange=async e=>{const t=e.target.files[0];if(t)try{const i=await t.text(),n=await this.$api.importConfig(i);n.success?(this.$message.success("配置导入成功"),await this.loadProviders(),await this.loadModels(),await this.loadGatewayConfig(),this.loadWafConfig(),this.loadEmailConfig()):this.$message.error("导入失败: "+n.error)}catch(i){this.$message.error("导入失败: "+i.message)}},s.click()},async loadSongbingConfig(){try{const s=await this.$api.getSongbingConfig();this.songbingConfig=s.data}catch(s){console.error("Failed to load songbing config:",s)}},checkSongbingProvider(){this.songbingProvider=this.providers.find(s=>s.name==="自建AI平台")||null},authSongbing(){this.authForm.platformUrl=this.songbingConfig.platformUrl,this.showAuthDialog=!0},async confirmAuthSongbing(){const{platformUrl:s}=this.authForm;if(!s){this.$message.error("请输入平台地址");return}if(!s.startsWith("http://")&&!s.startsWith("https://")){this.$message.error("平台地址必须以 http:// 或 https:// 开头");return}this.showAuthDialog=!1,this.authLoading=!0,this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null);try{const e=await this.$api.startSongbingAuth(s),{key:t,auth_url:i}=e.data;window.open(s+i,"_blank"),this.$message.info("请在打开的页面完成授权,认证中...");let n=0;this.pollTimer=setInterval(async()=>{var r;if(n++,n>=100){clearInterval(this.pollTimer),this.pollTimer=null,this.$message.warning("认证超时,请重试"),this.authLoading=!1;return}try{const o=await this.$api.verifySongbingAuth(t);(r=o.data)!=null&&r.active&&(clearInterval(this.pollTimer),this.pollTimer=null,this.$message.success(`自建AI平台 认证成功!已同步 ${o.data.syncedModels} 个模型`),await this.loadProviders(),await this.loadModels(),this.checkSongbingProvider(),this.authLoading=!1)}catch{}},3e3)}catch(e){this.$message.error("认证失败: "+e.message),this.authLoading=!1}},async cancelSongbingAuth(){try{await this.$confirm("确定要取消认证吗?取消后已同步的模型将被删除。","提示",{type:"warning"}),await this.$api.cancelSongbingAuth(),this.$message.success("已取消认证"),await this.loadProviders(),await this.loadModels(),this.songbingProvider=null}catch(s){s!=="cancel"&&this.$message.error("取消认证失败: "+s.message)}},async syncSongbingModels(){if(!this.songbingProvider){this.$message.warning("请先完成认证");return}try{const s=await this.$api.syncSongbingModels();this.$message.success(`同步成功,新增 ${s.data.count} 个模型`),await this.loadModels()}catch(s){this.$message.error("同步模型失败: "+s.message)}}},beforeDestroy(){this.pollTimer&&clearInterval(this.pollTimer)}};var KFe=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex-1 flex overflow-hidden bg-[#1e1e1e]"},[t("aside",{staticClass:"w-[220px] bg-sidebar border-r border-border shrink-0 py-4"},[t("h2",{staticClass:"text-white font-bold text-lg px-4 mb-4"},[e._v("设置")]),t("nav",{staticClass:"space-y-1"},e._l(e.tabs,function(i){return t("button",{key:i.name,staticClass:"w-full text-left px-4 py-2 text-sm flex items-center gap-2 transition-colors",class:e.activeTab===i.name?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(n){e.activeTab=i.name}}},[t("i",{class:i.icon}),e._v(" "+e._s(i.label)+" ")])}),0)]),t("main",{staticClass:"flex-1 overflow-y-auto p-6"},[t("div",{staticClass:"max-w-3xl mx-auto"},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="providers",expression:"activeTab === 'providers'"}]},[t("ProviderList",{attrs:{providers:e.providers,models:e.models,"songbing-provider":e.songbingProvider},on:{"add-provider":function(i){return e.openProviderDialog(null)},"edit-provider":function(i){return e.openProviderDialog(i)},"delete-provider":e.deleteProvider,"add-model":function(i){return e.openModelDialog(i,null)},"edit-model":function(i){return e.openModelDialog(i.providerId,i)},"delete-model":e.deleteModel,"export-config":e.handleExportConfig,"import-config":e.handleImportConfig,"auth-songbing":e.authSongbing,"sync-songbing-models":e.syncSongbingModels,"cancel-songbing-auth":e.cancelSongbingAuth}})],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="skills",expression:"activeTab === 'skills'"}]},[t("h3",{staticClass:"text-xl text-white mb-4"},[e._v("Skills")]),t("SkillsList",{attrs:{skills:e.skills}})],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="advanced",expression:"activeTab === 'advanced'"}]},[t("h3",{staticClass:"text-xl text-white mb-4"},[e._v("高级设置")]),t("el-form",{staticClass:"advanced-form",attrs:{"label-width":"150px"}},[t("el-form-item",{attrs:{label:"最大工具轮数"}},[t("el-input-number",{attrs:{min:1,max:100},on:{change:function(i){return e.saveConfig("maxToolIterations",i)}},model:{value:e.config.maxToolIterations,callback:function(i){e.$set(e.config,"maxToolIterations",i)},expression:"config.maxToolIterations"}})],1),t("el-form-item",{attrs:{label:"会话压缩阈值"}},[t("el-input-number",{attrs:{min:1,max:100},on:{change:function(i){return e.saveConfig("maxSessionCompression",i)}},model:{value:e.config.maxSessionCompression,callback:function(i){e.$set(e.config,"maxSessionCompression",i)},expression:"config.maxSessionCompression"}})],1),t("el-form-item",{attrs:{label:"Web 服务端口"}},[t("el-input-number",{attrs:{min:1024,max:65535},on:{change:function(i){return e.saveConfig("web.port",i)}},model:{value:e.config.webPort,callback:function(i){e.$set(e.config,"webPort",i)},expression:"config.webPort"}})],1)],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="proxy",expression:"activeTab === 'proxy'"}]},[t("h3",{staticClass:"text-xl text-white mb-4"},[e._v("代理设置")]),t("el-form",{staticClass:"advanced-form",attrs:{"label-width":"150px"}},[t("el-form-item",{attrs:{label:"启用代理"}},[t("el-switch",{on:{change:e.saveProxyConfig},model:{value:e.proxyConfig.enabled,callback:function(i){e.$set(e.proxyConfig,"enabled",i)},expression:"proxyConfig.enabled"}})],1),t("el-form-item",{attrs:{label:"代理类型"}},[t("el-select",{attrs:{disabled:!e.proxyConfig.enabled},on:{change:e.saveProxyConfig},model:{value:e.proxyConfig.type,callback:function(i){e.$set(e.proxyConfig,"type",i)},expression:"proxyConfig.type"}},[t("el-option",{attrs:{label:"HTTP",value:"http"}}),t("el-option",{attrs:{label:"SOCKS5",value:"socks5"}})],1)],1),t("el-form-item",{attrs:{label:"代理IP"}},[t("el-input",{attrs:{disabled:!e.proxyConfig.enabled},on:{blur:e.saveProxyConfig},model:{value:e.proxyConfig.host,callback:function(i){e.$set(e.proxyConfig,"host",i)},expression:"proxyConfig.host"}})],1),t("el-form-item",{attrs:{label:"代理端口"}},[t("el-input-number",{attrs:{min:1,max:65535,disabled:!e.proxyConfig.enabled},on:{change:e.saveProxyConfig},model:{value:e.proxyConfig.port,callback:function(i){e.$set(e.proxyConfig,"port",i)},expression:"proxyConfig.port"}})],1)],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="gateway",expression:"activeTab === 'gateway'"}]},[t("h3",{staticClass:"text-xl text-white mb-4"},[e._v("网关配置")]),t("el-form",{staticClass:"gateway-form",attrs:{"label-width":"150px"}},[t("el-form-item",{attrs:{label:"启用钉钉机器人"}},[t("el-switch",{on:{change:e.saveGatewayConfig},model:{value:e.gateway.enabled,callback:function(i){e.$set(e.gateway,"enabled",i)},expression:"gateway.enabled"}})],1),t("el-form-item",{attrs:{label:"Client ID"}},[t("el-input",{attrs:{placeholder:"请输入Client ID"},on:{blur:e.saveGatewayConfig},model:{value:e.gateway.clientId,callback:function(i){e.$set(e.gateway,"clientId",i)},expression:"gateway.clientId"}})],1),t("el-form-item",{attrs:{label:"Client Secret"}},[t("el-input",{attrs:{type:"password",placeholder:"请输入Client Secret"},on:{blur:e.saveGatewayConfig},model:{value:e.gateway.clientSecret,callback:function(i){e.$set(e.gateway,"clientSecret",i)},expression:"gateway.clientSecret"}})],1),t("el-form-item",{attrs:{label:"运行状态"}},[t("el-tag",{attrs:{type:e.gatewayStatus.running?"success":"info"}},[e._v(" "+e._s(e.gatewayStatus.running?"运行中":"已停止")+" ")]),e.gatewayStatus.configured&&!e.gatewayStatus.running?t("span",{staticClass:"text-textMuted text-sm ml-2"},[e._v(" (配置已保存,可启动) ")]):e._e()],1),t("el-form-item",[t("el-button",{attrs:{type:"primary",loading:e.gatewayLoading},on:{click:e.toggleGateway}},[e._v(" "+e._s(e.gatewayStatus.running?"停止":"启动")+" ")])],1)],1),t("h3",{staticClass:"text-xl text-white mb-4 mt-8"},[e._v("梓豪WAF网关配置")]),t("el-form",{staticClass:"gateway-form",attrs:{"label-width":"150px"}},[t("el-form-item",{attrs:{label:"服务器IP"}},[t("el-input",{attrs:{placeholder:"请输入服务器IP地址"},on:{blur:e.saveWafConfig},model:{value:e.wafGateway.serverIp,callback:function(i){e.$set(e.wafGateway,"serverIp",i)},expression:"wafGateway.serverIp"}})],1),t("el-form-item",{attrs:{label:"秘钥"}},[t("el-input",{attrs:{type:"password",placeholder:"请输入秘钥","show-password":""},on:{blur:e.saveWafConfig},model:{value:e.wafGateway.secretKey,callback:function(i){e.$set(e.wafGateway,"secretKey",i)},expression:"wafGateway.secretKey"}})],1),t("el-form-item",{attrs:{label:"运行状态"}},[t("div",{staticClass:"flex items-center gap-2"},[t("span",{staticClass:"w-2 h-2 rounded-full",class:e.wafStatus.status==="running"?"bg-green-500":"bg-gray-400"}),t("el-tag",{attrs:{type:e.wafStatus.status==="running"?"success":"info"}},[e._v(" "+e._s(e.wafStatus.status==="running"?"运行中":"已停止")+" ")])],1)]),t("el-form-item",[t("el-button",{attrs:{type:"primary",loading:e.wafGatewayLoading,disabled:!e.wafStatus.configured},on:{click:e.toggleWafGateway}},[e._v(" "+e._s(e.wafStatus.status==="running"?"停止":"启动")+" ")])],1)],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="email",expression:"activeTab === 'email'"}]},[t("h3",{staticClass:"text-xl text-white mb-4"},[e._v("邮件配置")]),t("el-form",{staticClass:"gateway-form",attrs:{"label-width":"150px"}},[t("el-form-item",{attrs:{label:"SMTP 服务器"}},[t("el-input",{attrs:{placeholder:"smtp.example.com"},on:{blur:e.saveEmailConfig},model:{value:e.emailConfig.host,callback:function(i){e.$set(e.emailConfig,"host",i)},expression:"emailConfig.host"}})],1),t("el-form-item",{attrs:{label:"端口"}},[t("el-input-number",{attrs:{min:1,max:65535},on:{change:e.saveEmailConfig},model:{value:e.emailConfig.port,callback:function(i){e.$set(e.emailConfig,"port",i)},expression:"emailConfig.port"}})],1),t("el-form-item",{attrs:{label:"使用 SSL/TLS"}},[t("el-switch",{on:{change:e.saveEmailConfig},model:{value:e.emailConfig.secure,callback:function(i){e.$set(e.emailConfig,"secure",i)},expression:"emailConfig.secure"}})],1),t("el-form-item",{attrs:{label:"用户名"}},[t("el-input",{attrs:{placeholder:"邮箱地址"},on:{blur:e.saveEmailConfig},model:{value:e.emailConfig.user,callback:function(i){e.$set(e.emailConfig,"user",i)},expression:"emailConfig.user"}})],1),t("el-form-item",{attrs:{label:"密码/授权码"}},[t("el-input",{attrs:{type:"password",placeholder:"邮箱密码或授权码","show-password":""},on:{blur:e.saveEmailConfig},model:{value:e.emailConfig.password,callback:function(i){e.$set(e.emailConfig,"password",i)},expression:"emailConfig.password"}})],1),t("el-form-item",{attrs:{label:"发件人名称"}},[t("el-input",{attrs:{placeholder:"显示的发件人名称(可选)"},on:{blur:e.saveEmailConfig},model:{value:e.emailConfig.fromName,callback:function(i){e.$set(e.emailConfig,"fromName",i)},expression:"emailConfig.fromName"}})],1),t("el-form-item",{attrs:{label:"运行状态"}},[t("el-tag",{attrs:{type:e.emailStatus.valid?"success":"info"}},[e._v(" "+e._s(e.emailStatus.valid?"配置有效":e.emailStatus.valid===!1?"配置无效":"未配置")+" ")])],1),t("el-form-item",[t("el-button",{attrs:{type:"primary",loading:e.emailLoading},on:{click:e.testEmailConfig}},[e._v("测试连接")])],1)],1)],1)])]),t("ProviderDialog",{attrs:{visible:e.showProviderDialog,"editing-provider":e.editingProvider},on:{"update:visible":function(i){e.showProviderDialog=i},success:e.loadProviders}}),t("ModelDialog",{attrs:{visible:e.showModelDialog,"editing-model":e.editingModel,providers:e.providers,"default-provider-id":e.defaultProviderId},on:{"update:visible":function(i){e.showModelDialog=i},success:e.loadModels}}),t("el-dialog",{attrs:{title:"自建AI平台认证",visible:e.showAuthDialog,width:"500px","close-on-click-modal":!1},on:{"update:visible":function(i){e.showAuthDialog=i}}},[t("el-form",{attrs:{"label-width":"80px"}},[t("el-form-item",{attrs:{label:"平台地址"}},[t("el-input",{model:{value:e.authForm.platformUrl,callback:function(i){e.$set(e.authForm,"platformUrl",i)},expression:"authForm.platformUrl"}})],1),t("el-alert",{staticStyle:{"margin-top":"10px"},attrs:{title:"注意:填写您的自建AI平台服务地址",type:"info",closable:!1}})],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(i){e.showAuthDialog=!1}}},[e._v("取消")]),t("el-button",{attrs:{type:"primary",loading:e.authLoading},on:{click:e.confirmAuthSongbing}},[e._v("开始认证")])],1)],1)],1)},GFe=[],YFe=en(qFe,KFe,GFe,!1,null,"c3903b2c");const pve=YFe.exports,ZFe={name:"FileTreeNode",props:{node:{type:Object,required:!0},level:{type:Number,default:0},selectedPath:{type:String,default:""},expandedPaths:{type:Set,default:()=>new Set}},data(){return{expanded:!1,loading:!1,loadedChildren:this.node.children||[]}},computed:{isSelected(){return this.selectedPath===this.node.path}},watch:{node:{immediate:!0,handler(s){s.children&&s.children.length>0&&(this.loadedChildren=s.children)}},expandedPaths:{immediate:!0,handler(s){this.node.is_directory&&(s.has(this.node.path)&&!this.expanded?this.ensureExpanded():!s.has(this.node.path)&&this.expanded&&(this.expanded=!1))}}},methods:{async toggleExpand(){if(this.node.is_directory)if(!this.expanded&&this.loadedChildren.length===0&&this.node.has_children){this.loading=!0;try{this.$emit("load-children",{path:this.node.path,callback:s=>{this.loadedChildren=s,this.expanded=!0,this.loading=!1,this.$emit("expand-path",this.node.path)}})}catch(s){console.error("Failed to load children:",s),this.loading=!1}}else this.expanded=!this.expanded,this.expanded?this.$emit("expand-path",this.node.path):this.$emit("collapse-path",this.node.path)},ensureExpanded(){this.expanded||(this.loadedChildren.length===0&&this.node.has_children?(this.loading=!0,this.$emit("load-children",{path:this.node.path,callback:s=>{this.loadedChildren=s,this.expanded=!0,this.loading=!1}})):this.expanded=!0)},handleClick(){this.$emit("select",this.node),this.node.is_directory&&this.toggleExpand()},handleDblClick(){this.node.is_directory?this.toggleExpand():this.$emit("open-file",this.node)},handleContextMenu(s){s.stopPropagation(),this.$emit("contextmenu",s,this.node)},getFileIcon(s,e){if(e)return"fa-solid fa-folder text-yellow-500";const t=s.split(".").pop().toLowerCase(),i=s.toLowerCase(),n={js:"fa-brands fa-js text-yellow-400",jsx:"fa-brands fa-react text-blue-400",ts:"fa-brands fa-js text-blue-400",tsx:"fa-brands fa-react text-blue-400",html:"fa-brands fa-html5 text-orange-500",htm:"fa-brands fa-html5 text-orange-500",css:"fa-brands fa-css3 text-blue-400",scss:"fa-brands fa-sass text-pink-400",sass:"fa-brands fa-sass text-pink-400",vue:"fa-brands fa-vuejs text-green-400",py:"fa-brands fa-python text-blue-500",pyc:"fa-brands fa-python text-gray-400",json:"fa-solid fa-file-code text-yellow-300",yaml:"fa-solid fa-file-code text-blue-300",yml:"fa-solid fa-file-code text-blue-300",xml:"fa-solid fa-file-code text-orange-300",md:"fa-solid fa-file-lines text-gray-400",markdown:"fa-solid fa-file-lines text-gray-400",sql:"fa-solid fa-database text-gray-400",sh:"fa-solid fa-terminal text-green-400",bash:"fa-solid fa-terminal text-green-400",go:"fa-brands fa-golang text-cyan-400",rs:"fa-brands fa-rust text-orange-400",java:"fa-brands fa-java text-red-400",kt:"fa-brands fa-android text-purple-400",swift:"fa-brands fa-apple text-blue-300",c:"fa-solid fa-file-code text-blue-300",cpp:"fa-solid fa-file-code text-blue-400",cc:"fa-solid fa-file-code text-blue-400",h:"fa-solid fa-file-code text-blue-300",hpp:"fa-solid fa-file-code text-blue-400",cs:"fa-brands fa-microsoft text-purple-400",rb:"fa-solid fa-gem text-red-400",php:"fa-brands fa-php text-purple-400",dockerfile:"fa-brands fa-docker text-blue-400",gitignore:"fa-brands fa-git text-red-400",gitattributes:"fa-brands fa-git text-red-400",license:"fa-solid fa-scale-balanced text-yellow-400",png:"fa-solid fa-image text-green-400",jpg:"fa-solid fa-image text-green-400",jpeg:"fa-solid fa-image text-green-400",gif:"fa-solid fa-image text-green-400",svg:"fa-solid fa-image text-green-400",ico:"fa-solid fa-image text-green-400",webp:"fa-solid fa-image text-green-400",bmp:"fa-solid fa-image text-green-400",mp4:"fa-solid fa-film text-purple-400",avi:"fa-solid fa-film text-purple-400",mov:"fa-solid fa-film text-purple-400",mkv:"fa-solid fa-film text-purple-400",mp3:"fa-solid fa-music text-pink-400",wav:"fa-solid fa-music text-pink-400",flac:"fa-solid fa-music text-pink-400",woff:"fa-solid fa-font text-blue-400",woff2:"fa-solid fa-font text-blue-400",ttf:"fa-solid fa-font text-blue-400",otf:"fa-solid fa-font text-blue-400",eot:"fa-solid fa-font text-blue-400",zip:"fa-solid fa-file-zipper text-yellow-600",rar:"fa-solid fa-file-zipper text-yellow-600","7z":"fa-solid fa-file-zipper text-yellow-600",tar:"fa-solid fa-file-zipper text-yellow-600",gz:"fa-solid fa-file-zipper text-yellow-600",pdf:"fa-solid fa-file-pdf text-red-500",doc:"fa-solid fa-file-word text-blue-600",docx:"fa-solid fa-file-word text-blue-600",xls:"fa-solid fa-file-excel text-green-600",xlsx:"fa-solid fa-file-excel text-green-600",ppt:"fa-solid fa-file-powerpoint text-orange-600",pptx:"fa-solid fa-file-powerpoint text-orange-600"};return i==="dockerfile"?n.dockerfile:i===".gitignore"?n.gitignore:i===".gitattributes"?n.gitattributes:i==="license"||i.startsWith("license")?n.license:i.startsWith("readme")?n.md:n[t]||"fa-solid fa-file text-gray-400"}}};var XFe=function(){var i;var e=this,t=e._self._c;return t("div",{staticClass:"file-tree-node"},[t("div",{staticClass:"node-content",class:{selected:e.isSelected,directory:e.node.is_directory},style:{paddingLeft:e.level*16+4+"px"},on:{click:e.handleClick,dblclick:e.handleDblClick,contextmenu:function(n){return n.preventDefault(),e.handleContextMenu.apply(null,arguments)}}},[e.node.is_directory?t("span",{staticClass:"expand-icon",on:{click:function(n){return n.stopPropagation(),e.toggleExpand.apply(null,arguments)}}},[e.loading?t("i",{staticClass:"fa-solid fa-spinner fa-spin"}):e.expanded?t("i",{staticClass:"fa-solid fa-chevron-down"}):e.node.has_children||e.node.children&&e.node.children.length>0?t("i",{staticClass:"fa-solid fa-chevron-right"}):t("span",{staticClass:"placeholder"})]):t("span",{staticClass:"expand-icon placeholder"}),t("span",{staticClass:"node-icon"},[t("i",{class:e.getFileIcon(e.node.name,e.node.is_directory)})]),t("span",{staticClass:"node-name"},[e._v(e._s(e.node.name))])]),e.node.is_directory&&e.expanded&&(e.loadedChildren.length>0||((i=e.node.children)==null?void 0:i.length)>0)?t("div",{staticClass:"children"},e._l(e.loadedChildren.length>0?e.loadedChildren:e.node.children,function(n){return t("file-tree-node",{key:n.path,attrs:{node:n,level:e.level+1,"selected-path":e.selectedPath,"expanded-paths":e.expandedPaths},on:{select:function(r){return e.$emit("select",r)},"open-file":function(r){return e.$emit("open-file",r)},"load-children":function(r){return e.$emit("load-children",r)},contextmenu:(r,o)=>e.$emit("contextmenu",r,o),"expand-path":function(r){return e.$emit("expand-path",r)},"collapse-path":function(r){return e.$emit("collapse-path",r)}}})}),1):e._e()])},QFe=[],JFe=en(ZFe,XFe,QFe,!1,null,"2802cc18");const e4e=JFe.exports,t4e={name:"CopyPathDialog",data(){return{visible:!1,path:""}},methods:{open(s){this.path=s,this.visible=!0},handleClose(){this.path=""},handleCopy(){navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(this.path).then(()=>{this.$message.success("路径已复制")}).catch(()=>{this.$message.info("请手动 Ctrl+C 复制")}):this.$message.info("请手动 Ctrl+C 复制"),this.visible=!1}}};var i4e=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:"文件路径",visible:e.visible,width:"500px","close-on-click-modal":!0},on:{"update:visible":function(i){e.visible=i},close:e.handleClose}},[t("div",{staticClass:"flex gap-2"},[t("el-input",{staticClass:"flex-1",attrs:{readonly:""},model:{value:e.path,callback:function(i){e.path=i},expression:"path"}}),t("el-button",{attrs:{type:"primary"},on:{click:e.handleCopy}},[e._v("复制")])],1)])},n4e=[],s4e=en(t4e,i4e,n4e,!1,null,null);const r4e=s4e.exports;function bc(s,e=0){return s[s.length-(1+e)]}function o4e(s){if(s.length===0)throw new Error("Invalid tail call");return[s.slice(0,s.length-1),s[s.length-1]]}function Mn(s,e,t=(i,n)=>i===n){if(s===e)return!0;if(!s||!e||s.length!==e.length)return!1;for(let i=0,n=s.length;i<n;i++)if(!t(s[i],e[i]))return!1;return!0}function a4e(s,e){const t=s.length-1;e<t&&(s[e]=s[t]),s.pop()}function _E(s,e,t){return l4e(s.length,i=>t(s[i],e))}function l4e(s,e){let t=0,i=s-1;for(;t<=i;){const n=(t+i)/2|0,r=e(n);if(r<0)t=n+1;else if(r>0)i=n-1;else return n}return-(t+1)}function EU(s,e,t){if(s=s|0,s>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],n=[],r=[],o=[];for(const a of e){const l=t(a,i);l<0?n.push(a):l>0?r.push(a):o.push(a)}return s<n.length?EU(s,n,t):s<n.length+o.length?o[0]:EU(s-(n.length+o.length),r,t)}function oce(s,e){const t=[];let i;for(const n of s.slice(0).sort(e))!i||e(i[0],n)!==0?(i=[n],t.push(i)):i.push(n);return t}function*fee(s,e){let t,i;for(const n of s)i!==void 0&&e(i,n)?t.push(n):(t&&(yield t),t=[n]),i=n;t&&(yield t)}function mve(s,e){for(let t=0;t<=s.length;t++)e(t===0?void 0:s[t-1],t===s.length?void 0:s[t])}function c4e(s,e){for(let t=0;t<s.length;t++)e(t===0?void 0:s[t-1],s[t],t+1===s.length?void 0:s[t+1])}function Id(s){return s.filter(e=>!!e)}function ace(s){let e=0;for(let t=0;t<s.length;t++)s[t]&&(s[e]=s[t],e+=1);s.length=e}function _ve(s){return!Array.isArray(s)||s.length===0}function xo(s){return Array.isArray(s)&&s.length>0}function Mg(s,e=t=>t){const t=new Set;return s.filter(i=>{const n=e(i);return t.has(n)?!1:(t.add(n),!0)})}function gee(s,e){return s.length>0?s[0]:e}function ua(s,e){let t=typeof e=="number"?s:0;typeof e=="number"?t=s:(t=0,e=s);const i=[];if(t<=e)for(let n=t;n<e;n++)i.push(n);else for(let n=t;n>e;n--)i.push(n);return i}function mV(s,e,t){const i=s.slice(0,e),n=s.slice(e);return i.concat(t,n)}function P$(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.unshift(e))}function yA(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.push(e))}function TU(s,e){for(const t of e)s.push(t)}function pee(s){return Array.isArray(s)?s:[s]}function d4e(s,e,t){const i=vve(s,e),n=s.length,r=t.length;s.length=n+r;for(let o=n-1;o>=i;o--)s[o+r]=s[o];for(let o=0;o<r;o++)s[o+i]=t[o]}function lce(s,e,t,i){const n=vve(s,e);let r=s.splice(n,t);return r===void 0&&(r=[]),d4e(s,n,i),r}function vve(s,e){return e<0?Math.max(e+s.length,0):Math.min(e,s.length)}var vE;(function(s){function e(r){return r<0}s.isLessThan=e;function t(r){return r<=0}s.isLessThanOrEqual=t;function i(r){return r>0}s.isGreaterThan=i;function n(r){return r===0}s.isNeitherLessOrGreaterThan=n,s.greaterThan=1,s.lessThan=-1,s.neitherLessOrGreaterThan=0})(vE||(vE={}));function Ko(s,e){return(t,i)=>e(s(t),s(i))}function u4e(...s){return(e,t)=>{for(const i of s){const n=i(e,t);if(!vE.isNeitherLessOrGreaterThan(n))return n}return vE.neitherLessOrGreaterThan}}const kd=(s,e)=>s-e,h4e=(s,e)=>kd(s?1:0,e?1:0);function bve(s){return(e,t)=>-s(e,t)}class Rg{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<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;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}}const k0=class k0{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new k0(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new k0(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||vE.isGreaterThan(e(n,t)))&&(i=!1,t=n),!0)),t}};k0.empty=new k0(e=>{});let Nb=k0;class o4{constructor(e){this._indexMap=e}static createSortPermutation(e,t){const i=Array.from(e.keys()).sort((n,r)=>t(e[n],e[r]));return new o4(i)}apply(e){return e.map((t,i)=>e[this._indexMap[i]])}inverse(){const e=this._indexMap.slice();for(let t=0;t<this._indexMap.length;t++)e[this._indexMap[t]]=t;return new o4(e)}}function ya(s){return typeof s=="string"}function ar(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&!(s instanceof RegExp)&&!(s instanceof Date)}function f4e(s){const e=Object.getPrototypeOf(Uint8Array);return typeof s=="object"&&s instanceof e}function Jm(s){return typeof s=="number"&&!isNaN(s)}function cce(s){return!!s&&typeof s[Symbol.iterator]=="function"}function Cve(s){return s===!0||s===!1}function So(s){return typeof s>"u"}function jh(s){return!Wl(s)}function Wl(s){return So(s)||s===null}function yi(s,e){if(!s)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function om(s){if(Wl(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function bE(s){return typeof s=="function"}function g4e(s,e){const t=Math.min(s.length,e.length);for(let i=0;i<t;i++)p4e(s[i],e[i])}function p4e(s,e){if(ya(e)){if(typeof s!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(bE(e)){try{if(s instanceof e)return}catch{}if(!Wl(s)&&s.constructor===e||e.length===1&&e.call(void 0,s)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function Yf(s){if(!s||typeof s!="object"||s instanceof RegExp)return s;const e=Array.isArray(s)?[]:{};return Object.entries(s).forEach(([t,i])=>{e[t]=i&&typeof i=="object"?Yf(i):i}),e}function m4e(s){if(!s||typeof s!="object")return s;const e=[s];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(yve.call(t,i)){const n=t[i];typeof n=="object"&&!Object.isFrozen(n)&&!f4e(n)&&e.push(n)}}return s}const yve=Object.prototype.hasOwnProperty;function wve(s,e){return NU(s,e,new Set)}function NU(s,e,t){if(Wl(s))return s;const i=e(s);if(typeof i<"u")return i;if(Array.isArray(s)){const n=[];for(const r of s)n.push(NU(r,e,t));return n}if(ar(s)){if(t.has(s))throw new Error("Cannot clone recursive data-structure");t.add(s);const n={};for(const r in s)yve.call(s,r)&&(n[r]=NU(s[r],e,t));return t.delete(s),n}return s}function _V(s,e,t=!0){return ar(s)?(ar(e)&&Object.keys(e).forEach(i=>{i in s?t&&(ar(s[i])&&ar(e[i])?_V(s[i],e[i],t):s[i]=e[i]):s[i]=e[i]}),s):e}function sl(s,e){if(s===e)return!0;if(s==null||e===null||e===void 0||typeof s!=typeof e||typeof s!="object"||Array.isArray(s)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(s)){if(s.length!==e.length)return!1;for(t=0;t<s.length;t++)if(!sl(s[t],e[t]))return!1}else{const n=[];for(i in s)n.push(i);n.sort();const r=[];for(i in e)r.push(i);if(r.sort(),!sl(n,r))return!1;for(t=0;t<n.length;t++)if(!sl(s[n[t]],e[n[t]]))return!1}return!0}function _4e(s){let e=[];for(;Object.prototype!==s;)e=e.concat(Object.getOwnPropertyNames(s)),s=Object.getPrototypeOf(s);return e}function MU(s){const e=[];for(const t of _4e(s))typeof s[t]=="function"&&e.push(t);return e}function v4e(s,e){const t=n=>function(){const r=Array.prototype.slice.call(arguments,0);return e(n,r)},i={};for(const n of s)i[n]=t(n);return i}function Sve(){return globalThis._VSCODE_NLS_MESSAGES}function mee(){return globalThis._VSCODE_NLS_LANGUAGE}const b4e=mee()==="pseudo"||typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function a4(s,e){let t;return e.length===0?t=s:t=s.replace(/\{(\d+)\}/g,(i,n)=>{const r=n[0],o=e[r];let a=i;return typeof o=="string"?a=o:(typeof o=="number"||typeof o=="boolean"||o===void 0||o===null)&&(a=String(o)),a}),b4e&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function w(s,e,...t){return a4(typeof s=="number"?xve(s,e):e,t)}function xve(s,e){var i;const t=(i=Sve())==null?void 0:i[s];if(typeof t!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${s} !!!`)}return t}function Lt(s,e,...t){let i;typeof s=="number"?i=xve(s,e):i=e;const n=a4(i,t);return{value:n,original:e===i?n:a4(e,t)}}const e0="en";let l4=!1,c4=!1,G2=!1,kve=!1,_ee=!1,vee=!1,Lve=!1,wA,Y2=e0,dce=e0,C4e,Qd;const wg=globalThis;let Fo;var Npe;typeof wg.vscode<"u"&&typeof wg.vscode.process<"u"?Fo=wg.vscode.process:typeof process<"u"&&typeof((Npe=process==null?void 0:process.versions)==null?void 0:Npe.node)=="string"&&(Fo=process);var Mpe;const y4e=typeof((Mpe=Fo==null?void 0:Fo.versions)==null?void 0:Mpe.electron)=="string",w4e=y4e&&(Fo==null?void 0:Fo.type)==="renderer";var Rpe;if(typeof Fo=="object"){l4=Fo.platform==="win32",c4=Fo.platform==="darwin",G2=Fo.platform==="linux",G2&&Fo.env.SNAP&&Fo.env.SNAP_REVISION,Fo.env.CI||Fo.env.BUILD_ARTIFACTSTAGINGDIRECTORY,wA=e0,Y2=e0;const s=Fo.env.VSCODE_NLS_CONFIG;if(s)try{const e=JSON.parse(s);wA=e.userLocale,dce=e.osLocale,Y2=e.resolvedLanguage||e0,C4e=(Rpe=e.languagePack)==null?void 0:Rpe.translationsConfigFile}catch{}kve=!0}else typeof navigator=="object"&&!w4e?(Qd=navigator.userAgent,l4=Qd.indexOf("Windows")>=0,c4=Qd.indexOf("Macintosh")>=0,vee=(Qd.indexOf("Macintosh")>=0||Qd.indexOf("iPad")>=0||Qd.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,G2=Qd.indexOf("Linux")>=0,Lve=(Qd==null?void 0:Qd.indexOf("Mobi"))>=0,_ee=!0,Y2=mee()||e0,wA=navigator.language.toLowerCase(),dce=wA):console.error("Unable to resolve platform.");const Kr=l4,ii=c4,Zo=G2,Yh=kve,My=_ee,S4e=_ee&&typeof wg.importScripts=="function",x4e=S4e?wg.origin:void 0,Ru=vee,Dve=Lve,Zh=Qd,k4e=Y2,L4e=typeof wg.postMessage=="function"&&!wg.importScripts,Ive=(()=>{if(L4e){const s=[];wg.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,n=s.length;i<n;i++){const r=s[i];if(r.id===t.data.vscodeScheduleAsyncWork){s.splice(i,1),r.callback();return}}});let e=0;return t=>{const i=++e;s.push({id:i,callback:t}),wg.postMessage({vscodeScheduleAsyncWork:i},"*")}}return s=>setTimeout(s)})(),il=c4||vee?2:l4?1:3;let uce=!0,hce=!1;function Eve(){if(!hce){hce=!0;const s=new Uint8Array(2);s[0]=1,s[1]=2,uce=new Uint16Array(s.buffer)[0]===513}return uce}const Tve=!!(Zh&&Zh.indexOf("Chrome")>=0),D4e=!!(Zh&&Zh.indexOf("Firefox")>=0),I4e=!!(!Tve&&Zh&&Zh.indexOf("Safari")>=0),E4e=!!(Zh&&Zh.indexOf("Edg/")>=0),T4e=!!(Zh&&Zh.indexOf("Android")>=0),to={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var hi;(function(s){function e(I){return I&&typeof I=="object"&&typeof I[Symbol.iterator]=="function"}s.is=e;const t=Object.freeze([]);function i(){return t}s.empty=i;function*n(I){yield I}s.single=n;function r(I){return e(I)?I:n(I)}s.wrap=r;function o(I){return I||t}s.from=o;function*a(I){for(let E=I.length-1;E>=0;E--)yield I[E]}s.reverse=a;function l(I){return!I||I[Symbol.iterator]().next().done===!0}s.isEmpty=l;function d(I){return I[Symbol.iterator]().next().value}s.first=d;function h(I,E){let R=0;for(const M of I)if(E(M,R++))return!0;return!1}s.some=h;function f(I,E){for(const R of I)if(E(R))return R}s.find=f;function*p(I,E){for(const R of I)E(R)&&(yield R)}s.filter=p;function*m(I,E){let R=0;for(const M of I)yield E(M,R++)}s.map=m;function*v(I,E){let R=0;for(const M of I)yield*E(M,R++)}s.flatMap=v;function*b(...I){for(const E of I)yield*E}s.concat=b;function y(I,E,R){let M=R;for(const O of I)M=E(M,O);return M}s.reduce=y;function*x(I,E,R=I.length){for(E<0&&(E+=I.length),R<0?R+=I.length:R>I.length&&(R=I.length);E<R;E++)yield I[E]}s.slice=x;function D(I,E=Number.POSITIVE_INFINITY){const R=[];if(E===0)return[R,I];const M=I[Symbol.iterator]();for(let O=0;O<E;O++){const V=M.next();if(V.done)return[R,s.empty()];R.push(V.value)}return[R,{[Symbol.iterator](){return M}}]}s.consume=D;async function S(I){const E=[];for await(const R of I)E.push(R);return Promise.resolve(E)}s.asyncToArray=S})(hi||(hi={}));var pg;let qs=(pg=class{constructor(e){this.element=e,this.next=pg.Undefined,this.prev=pg.Undefined}},pg.Undefined=new pg(void 0),pg);class $o{constructor(){this._first=qs.Undefined,this._last=qs.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===qs.Undefined}clear(){let e=this._first;for(;e!==qs.Undefined;){const t=e.next;e.prev=qs.Undefined,e.next=qs.Undefined,e=t}this._first=qs.Undefined,this._last=qs.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new qs(e);if(this._first===qs.Undefined)this._first=i,this._last=i;else if(t){const r=this._last;this._last=i,i.prev=r,r.next=i}else{const r=this._first;this._first=i,i.next=r,r.prev=i}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(i))}}shift(){if(this._first!==qs.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==qs.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==qs.Undefined&&e.next!==qs.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===qs.Undefined&&e.next===qs.Undefined?(this._first=qs.Undefined,this._last=qs.Undefined):e.next===qs.Undefined?(this._last=this._last.prev,this._last.next=qs.Undefined):e.prev===qs.Undefined&&(this._first=this._first.next,this._first.prev=qs.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==qs.Undefined;)yield e.element,e=e.next}}const d4="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function N4e(s=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of d4)s.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const bee=N4e();function Cee(s){let e=bee;if(s&&s instanceof RegExp)if(s.global)e=s;else{let t="g";s.ignoreCase&&(t+="i"),s.multiline&&(t+="m"),s.unicode&&(t+="u"),e=new RegExp(s.source,t)}return e.lastIndex=0,e}const Nve=new $o;Nve.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function CE(s,e,t,i,n){if(e=Cee(e),n||(n=hi.first(Nve)),t.length>n.maxLen){let d=s-n.maxLen/2;return d<0?d=0:i+=d,t=t.substring(d,s+n.maxLen/2),CE(s,e,t,i,n)}const r=Date.now(),o=s-1-i;let a=-1,l=null;for(let d=1;!(Date.now()-r>=n.timeBudget);d++){const h=o-n.windowSize*d;e.lastIndex=Math.max(0,h);const f=M4e(e,t,o,a);if(!f&&l||(l=f,h<=0))break;a=h}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 M4e(s,e,t,i){let n;for(;n=s.exec(e);){const r=n.index||0;if(r<=t&&s.lastIndex>=t)return n;if(i>0&&r>i)return null}return null}const mh=8;class Mve{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class Rve{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class kn{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return vV(e,t)}compute(e,t,i){return i}}class sI{constructor(e,t){this.newValue=e,this.didChange=t}}function vV(s,e){if(typeof s!="object"||typeof e!="object"||!s||!e)return new sI(e,s!==e);if(Array.isArray(s)||Array.isArray(e)){const i=Array.isArray(s)&&Array.isArray(e)&&Mn(s,e);return new sI(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const n=vV(s[i],e[i]);n.didChange&&(s[i]=n.newValue,t=!0)}return new sI(s,t)}class uN{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return vV(e,t)}validate(e){return this.defaultValue}}class Lx{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return vV(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function dt(s,e){return typeof s>"u"?e:s==="false"?!1:!!s}class bi extends Lx{constructor(e,t,i,n=void 0){typeof n<"u"&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return dt(e,this.defaultValue)}}function Vv(s,e,t,i){if(typeof s>"u")return e;let n=parseInt(s,10);return isNaN(n)?e:(n=Math.max(t,n),n=Math.min(i,n),n|0)}class sn extends Lx{static clampedInt(e,t,i,n){return Vv(e,t,i,n)}constructor(e,t,i,n,r,o=void 0){typeof o<"u"&&(o.type="integer",o.default=i,o.minimum=n,o.maximum=r),super(e,t,i,o),this.minimum=n,this.maximum=r}validate(e){return sn.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function R4e(s,e,t,i){if(typeof s>"u")return e;const n=zl.float(s,e);return zl.clamp(n,t,i)}class zl extends Lx{static clamp(e,t,i){return e<t?t:e>i?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,r){typeof r<"u"&&(r.type="number",r.default=i),super(e,t,i,r),this.validationFn=n}validate(e){return this.validationFn(zl.float(e,this.defaultValue))}}class Co extends Lx{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 Co.string(e,this.defaultValue)}}function Un(s,e,t,i){return typeof s!="string"?e:i&&s in i?i[s]:t.indexOf(s)===-1?e:s}class jn extends Lx{constructor(e,t,i,n,r=void 0){typeof r<"u"&&(r.type="string",r.enum=n,r.default=i),super(e,t,i,r),this._allowedValues=n}validate(e){return Un(e,this.defaultValue,this._allowedValues)}}class SA extends kn{constructor(e,t,i,n,r,o,a=void 0){typeof a<"u"&&(a.type="string",a.enum=r,a.default=n),super(e,t,i,a),this._allowedValues=r,this._convert=o}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function P4e(s){switch(s){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class O4e extends kn{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[w("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached."),w("accessibilitySupport.on","Optimize for usage with a Screen Reader."),w("accessibilitySupport.off","Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:w("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 A4e extends kn{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:w("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:w("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:dt(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:dt(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function F4e(s){switch(s){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var wr;(function(s){s[s.Line=1]="Line",s[s.Block=2]="Block",s[s.Underline=3]="Underline",s[s.LineThin=4]="LineThin",s[s.BlockOutline=5]="BlockOutline",s[s.UnderlineThin=6]="UnderlineThin"})(wr||(wr={}));function B4e(s){switch(s){case"line":return wr.Line;case"block":return wr.Block;case"underline":return wr.Underline;case"line-thin":return wr.LineThin;case"block-outline":return wr.BlockOutline;case"underline-thin":return wr.UnderlineThin}}class W4e extends uN{constructor(){super(143)}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(74)==="default"?n.push("mouse-default"):t.get(74)==="copy"&&n.push("mouse-copy"),t.get(112)&&n.push("showUnused"),t.get(141)&&n.push("showDeprecated"),n.join(" ")}}class V4e extends bi{constructor(){super(37,"emptySelectionClipboard",!0,{description:w("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class H4e extends kn{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:w("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:[w("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),w("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),w("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:w("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:[w("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),w("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),w("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:w("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:w("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:ii},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:w("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:w("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:dt(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":Un(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":Un(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:dt(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:dt(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:dt(t.loop,this.defaultValue.loop)}}}const jf=class jf extends kn{constructor(){super(51,"fontLigatures",jf.OFF,{anyOf:[{type:"boolean",description:w("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:w("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:w("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"||e.length===0?jf.OFF:e==="true"?jf.ON:e:e?jf.ON:jf.OFF}};jf.OFF='"liga" off, "calt" off',jf.ON='"liga" on, "calt" on';let e_=jf;const Uf=class Uf extends kn{constructor(){super(54,"fontVariations",Uf.OFF,{anyOf:[{type:"boolean",description:w("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:w("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:w("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"?Uf.OFF:e==="true"?Uf.TRANSLATE:e:e?Uf.TRANSLATE:Uf.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}};Uf.OFF="normal",Uf.TRANSLATE="translate";let yE=Uf;class $4e extends uN{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class z4e extends Lx{constructor(){super(52,"fontSize",Go.fontSize,{type:"number",minimum:6,maximum:100,default:Go.fontSize,description:w("fontSize","Controls the font size in pixels.")})}validate(e){const t=zl.float(e,this.defaultValue);return t===0?Go.fontSize:zl.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}const yh=class yh extends kn{constructor(){super(53,"fontWeight",Go.fontWeight,{anyOf:[{type:"number",minimum:yh.MINIMUM_VALUE,maximum:yh.MAXIMUM_VALUE,errorMessage:w("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:yh.SUGGESTION_VALUES}],default:Go.fontWeight,description:w("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(sn.clampedInt(e,Go.fontWeight,yh.MINIMUM_VALUE,yh.MAXIMUM_VALUE))}};yh.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],yh.MINIMUM_VALUE=1,yh.MAXIMUM_VALUE=1e3;let RU=yh;class j4e extends kn{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",multipleTests:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:"",alternativeTestsCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[w("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),w("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),w("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:w("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:w("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:w("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:w("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:w("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:w("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:w("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:w("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:w("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:w("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:w("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{multiple:Un(t.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:t.multipleDefinitions??Un(t.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:t.multipleTypeDefinitions??Un(t.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:t.multipleDeclarations??Un(t.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:t.multipleImplementations??Un(t.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:t.multipleReferences??Un(t.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),multipleTests:t.multipleTests??Un(t.multipleTests,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Co.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Co.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Co.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Co.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Co.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:Co.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}}class U4e extends kn{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:w("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:w("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:w("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:w("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:w("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:dt(t.enabled,this.defaultValue.enabled),delay:sn.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:dt(t.sticky,this.defaultValue.sticky),hidingDelay:sn.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:dt(t.above,this.defaultValue.above)}}}class $0 extends uN{constructor(){super(146)}compute(e,t,i){return $0.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 r=(i+e.viewLineCount+n)/(e.pixelRatio*e.height),o=Math.floor(e.viewLineCount/r);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:n,desiredRatio:r,minimapLineCount:o}}static _computeMinimapLayout(e,t){const i=e.outerWidth,n=e.outerHeight,r=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(r*n),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:n};const o=t.stableMinimapLayoutInput,a=o&&e.outerHeight===o.outerHeight&&e.lineHeight===o.lineHeight&&e.typicalHalfwidthCharacterWidth===o.typicalHalfwidthCharacterWidth&&e.pixelRatio===o.pixelRatio&&e.scrollBeyondLastLine===o.scrollBeyondLastLine&&e.paddingTop===o.paddingTop&&e.paddingBottom===o.paddingBottom&&e.minimap.enabled===o.minimap.enabled&&e.minimap.side===o.minimap.side&&e.minimap.size===o.minimap.size&&e.minimap.showSlider===o.minimap.showSlider&&e.minimap.renderCharacters===o.minimap.renderCharacters&&e.minimap.maxColumn===o.minimap.maxColumn&&e.minimap.scale===o.minimap.scale&&e.verticalScrollbarWidth===o.verticalScrollbarWidth&&e.isViewportWrapping===o.isViewportWrapping,l=e.lineHeight,d=e.typicalHalfwidthCharacterWidth,h=e.scrollBeyondLastLine,f=e.minimap.renderCharacters;let p=r>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const m=e.minimap.maxColumn,v=e.minimap.size,b=e.minimap.side,y=e.verticalScrollbarWidth,x=e.viewLineCount,D=e.remainingWidth,S=e.isViewportWrapping,I=f?2:3;let E=Math.floor(r*n);const R=E/r;let M=!1,O=!1,V=I*p,te=p/r,J=1;if(v==="fill"||v==="fit"){const{typicalViewportLineCount:Te,extraLinesBeforeFirstLine:Le,extraLinesBeyondLastLine:et,desiredRatio:Qe,minimapLineCount:kt}=$0.computeContainedMinimapLineCount({viewLineCount:x,scrollBeyondLastLine:h,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:n,lineHeight:l,pixelRatio:r});if(x/kt>1)M=!0,O=!0,p=1,V=1,te=p/r;else{let Tt=!1,Ft=p+1;if(v==="fit"){const ae=Math.ceil((Le+x+et)*V);S&&a&&D<=t.stableFitRemainingWidth?(Tt=!0,Ft=t.stableFitMaxMinimapScale):Tt=ae>E}if(v==="fill"||Tt){M=!0;const ae=p;V=Math.min(l*r,Math.max(1,Math.floor(1/Qe))),S&&a&&D<=t.stableFitRemainingWidth&&(Ft=t.stableFitMaxMinimapScale),p=Math.min(Ft,Math.max(1,Math.floor(V/I))),p>ae&&(J=Math.min(2,p/ae)),te=p/r/J,E=Math.ceil(Math.max(Te,Le+x+et)*V),S?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=D,t.stableFitMaxMinimapScale=p):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const z=Math.floor(m*te),H=Math.min(z,Math.max(0,Math.floor((D-y-2)*te/(d+te)))+mh);let G=Math.floor(r*H);const oe=G/r;G=Math.floor(G*J);const fe=f?1:2,we=b==="left"?0:i-H-y;return{renderMinimap:fe,minimapLeft:we,minimapWidth:H,minimapHeightIsEditorHeight:M,minimapIsSampling:O,minimapScale:p,minimapLineHeight:V,minimapCanvasInnerWidth:G,minimapCanvasInnerHeight:E,minimapCanvasOuterWidth:oe,minimapCanvasOuterHeight:R}}static computeLayout(e,t){const i=t.outerWidth|0,n=t.outerHeight|0,r=t.lineHeight|0,o=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,d=t.pixelRatio,h=t.viewLineCount,f=e.get(138),p=f==="inherit"?e.get(137):f,m=p==="inherit"?e.get(133):p,v=e.get(136),b=t.isDominatedByLongLines,y=e.get(57),x=e.get(68).renderType!==0,D=e.get(69),S=e.get(106),I=e.get(84),E=e.get(73),R=e.get(104),M=R.verticalScrollbarSize,O=R.verticalHasArrows,V=R.arrowSize,te=R.horizontalScrollbarSize,J=e.get(43),z=e.get(111)!=="never";let H=e.get(66);J&&z&&(H+=16);let G=0;if(x){const Ee=Math.max(o,D);G=Math.round(Ee*l)}let oe=0;y&&(oe=r*t.glyphMarginDecorationLaneCount);let fe=0,we=fe+oe,Te=we+G,Le=Te+H;const et=i-oe-G-H;let Qe=!1,kt=!1,ft=-1;p==="inherit"&&b?(Qe=!0,kt=!0):m==="on"||m==="bounded"?kt=!0:m==="wordWrapColumn"&&(ft=v);const Tt=$0._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:r,typicalHalfwidthCharacterWidth:a,pixelRatio:d,scrollBeyondLastLine:S,paddingTop:I.top,paddingBottom:I.bottom,minimap:E,verticalScrollbarWidth:M,viewLineCount:h,remainingWidth:et,isViewportWrapping:kt},t.memory||new Rve);Tt.renderMinimap!==0&&Tt.minimapLeft===0&&(fe+=Tt.minimapWidth,we+=Tt.minimapWidth,Te+=Tt.minimapWidth,Le+=Tt.minimapWidth);const Ft=et-Tt.minimapWidth,ae=Math.max(1,Math.floor((Ft-M-2)/a)),Ne=O?V:0;return kt&&(ft=Math.max(1,ae),m==="bounded"&&(ft=Math.min(ft,v))),{width:i,height:n,glyphMarginLeft:fe,glyphMarginWidth:oe,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:we,lineNumbersWidth:G,decorationsLeft:Te,decorationsWidth:H,contentLeft:Le,contentWidth:Ft,minimap:Tt,viewportColumn:ae,isWordWrapMinified:Qe,isViewportWrapping:kt,wrappingColumn:ft,verticalScrollbarWidth:M,horizontalScrollbarHeight:te,overviewRuler:{top:Ne,width:M,height:n-2*Ne,right:0}}}}class q4e extends kn{constructor(){super(140,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[w("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."),w("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:w("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 Un(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}var pd;(function(s){s.Off="off",s.OnCode="onCode",s.On="on"})(pd||(pd={}));class K4e extends kn{constructor(){const e={enabled:pd.OnCode};super(65,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",tags:["experimental"],enum:[pd.Off,pd.OnCode,pd.On],default:e.enabled,enumDescriptions:[w("editor.lightbulb.enabled.off","Disable the code action menu."),w("editor.lightbulb.enabled.onCode","Show the code action menu when the cursor is on lines with code."),w("editor.lightbulb.enabled.on","Show the code action menu when the cursor is on lines with code or on empty lines.")],description:w("enabled","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:Un(e.enabled,this.defaultValue.enabled,[pd.Off,pd.OnCode,pd.On])}}}class G4e extends kn{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(116,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:w("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor."),tags:["experimental"]},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:w("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:w("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:w("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:dt(t.enabled,this.defaultValue.enabled),maxLineCount:sn.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:Un(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:dt(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class Y4e extends kn{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(142,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:w("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[w("editor.inlayHints.on","Inlay hints are enabled"),w("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",ii?"Ctrl+Option":"Ctrl+Alt"),w("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",ii?"Ctrl+Option":"Ctrl+Alt"),w("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:w("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:w("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:w("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:Un(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:sn.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Co.string(t.fontFamily,this.defaultValue.fontFamily),padding:dt(t.padding,this.defaultValue.padding)}}}class Z4e extends kn{constructor(){super(66,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):sn.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?sn.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class X4e extends zl{constructor(){super(67,"lineHeight",Go.lineHeight,e=>zl.clamp(e,0,150),{markdownDescription:w("lineHeight",`Controls the line height.
|
|
204
204
|
- Use 0 to automatically compute the line height from the font size.
|
|
205
205
|
- Values between 0 and 8 will be used as a multiplier with the font size.
|
|
206
206
|
- Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class Q4e extends kn{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(73,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:w("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:w("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[w("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),w("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),w("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:w("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:w("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:w("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:w("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:w("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:w("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:w("minimap.showRegionSectionHeaders","Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:w("minimap.showMarkSectionHeaders","Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:w("minimap.sectionHeaderFontSize","Controls the font size of section headers in the minimap.")},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:e.sectionHeaderLetterSpacing,description:w("minimap.sectionHeaderLetterSpacing","Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:dt(t.enabled,this.defaultValue.enabled),autohide:dt(t.autohide,this.defaultValue.autohide),size:Un(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:Un(t.side,this.defaultValue.side,["right","left"]),showSlider:Un(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:dt(t.renderCharacters,this.defaultValue.renderCharacters),scale:sn.clampedInt(t.scale,1,1,3),maxColumn:sn.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:dt(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:dt(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),sectionHeaderFontSize:zl.clamp(t.sectionHeaderFontSize??this.defaultValue.sectionHeaderFontSize,4,32),sectionHeaderLetterSpacing:zl.clamp(t.sectionHeaderLetterSpacing??this.defaultValue.sectionHeaderLetterSpacing,0,5)}}}function J4e(s){return s==="ctrlCmd"?ii?"metaKey":"ctrlKey":"altKey"}class e5e extends kn{constructor(){super(84,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:w("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:w("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:sn.clampedInt(t.top,0,0,1e3),bottom:sn.clampedInt(t.bottom,0,0,1e3)}}}class t5e extends kn{constructor(){const e={enabled:!0,cycle:!0};super(86,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:w("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:w("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:dt(t.enabled,this.defaultValue.enabled),cycle:dt(t.cycle,this.defaultValue.cycle)}}}class i5e extends uN{constructor(){super(144)}compute(e,t,i){return e.pixelRatio}}class n5e extends kn{constructor(){super(88,"placeholder",void 0)}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e:this.defaultValue}}class s5e extends kn{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[w("on","Quick suggestions show inside the suggest widget"),w("inline","Quick suggestions show as ghost text"),w("off","Quick suggestions are disabled")]}];super(90,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:w("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:w("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:w("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:w("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,r=["on","inline","off"];let o,a,l;return typeof t=="boolean"?o=t?"on":"off":o=Un(t,this.defaultValue.other,r),typeof i=="boolean"?a=i?"on":"off":a=Un(i,this.defaultValue.comments,r),typeof n=="boolean"?l=n?"on":"off":l=Un(n,this.defaultValue.strings,r),{other:o,comments:a,strings:l}}}class r5e extends kn{constructor(){super(68,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[w("lineNumbers.off","Line numbers are not rendered."),w("lineNumbers.on","Line numbers are rendered as absolute number."),w("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),w("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:w("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 u4(s){const e=s.get(99);return e==="editable"?s.get(92):e!=="on"}class o5e extends kn{constructor(){const e=[],t={type:"number",description:w("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(103,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:w("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:w("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:sn.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const n=i;t.push({column:sn.clampedInt(n.column,0,0,1e4),color:n.color})}return t.sort((i,n)=>i.column-n.column),t}return this.defaultValue}}class a5e extends kn{constructor(){super(93,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function fce(s,e){if(typeof s!="string")return e;switch(s){case"hidden":return 2;case"visible":return 3;default:return 1}}let l5e=class extends kn{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(104,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[w("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),w("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),w("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:w("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[w("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),w("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),w("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:w("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:w("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:w("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:w("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:w("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=sn.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=sn.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:sn.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:fce(t.vertical,this.defaultValue.vertical),horizontal:fce(t.horizontal,this.defaultValue.horizontal),useShadows:dt(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:dt(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:dt(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:dt(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:dt(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:sn.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:sn.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:dt(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:dt(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}};const Nl="inUntrustedWorkspace",ga={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 c5e extends kn{constructor(){const e={nonBasicASCII:Nl,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Nl,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(126,"unicodeHighlight",e,{[ga.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Nl],default:e.nonBasicASCII,description:w("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.")},[ga.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:w("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[ga.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:w("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.")},[ga.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Nl],default:e.includeComments,description:w("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[ga.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Nl],default:e.includeStrings,description:w("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[ga.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:w("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[ga.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:w("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(sl(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},i=!0)),t.allowedLocales&&e&&(sl(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},i=!0));const n=super.applyUpdate(e,t);return i?new sI(n.newValue,!0):n}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:z0(t.nonBasicASCII,Nl,[!0,!1,Nl]),invisibleCharacters:dt(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:dt(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:z0(t.includeComments,Nl,[!0,!1,Nl]),includeStrings:z0(t.includeStrings,Nl,[!0,!1,Nl]),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,r]of Object.entries(e))r===!0&&(i[n]=!0);return i}}class d5e extends kn{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1,fontFamily:"default"};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:w("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:[w("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),w("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion."),w("inlineSuggest.showToolbar.never","Never show the inline suggestion toolbar.")],description:w("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:w("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.")},"editor.inlineSuggest.fontFamily":{type:"string",default:e.fontFamily,description:w("inlineSuggest.fontFamily","Controls the font family of the inline suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:dt(t.enabled,this.defaultValue.enabled),mode:Un(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:Un(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:dt(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:dt(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:Co.string(t.fontFamily,this.defaultValue.fontFamily)}}}class u5e extends kn{constructor(){const e={enabled:!1,showToolbar:"onHover",fontFamily:"default",keepOnBlur:!1};super(63,"experimentalInlineEdit",e,{"editor.experimentalInlineEdit.enabled":{type:"boolean",default:e.enabled,description:w("inlineEdit.enabled","Controls whether to show inline edits in the editor.")},"editor.experimentalInlineEdit.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[w("inlineEdit.showToolbar.always","Show the inline edit toolbar whenever an inline suggestion is shown."),w("inlineEdit.showToolbar.onHover","Show the inline edit toolbar when hovering over an inline suggestion."),w("inlineEdit.showToolbar.never","Never show the inline edit toolbar.")],description:w("inlineEdit.showToolbar","Controls when to show the inline edit toolbar.")},"editor.experimentalInlineEdit.fontFamily":{type:"string",default:e.fontFamily,description:w("inlineEdit.fontFamily","Controls the font family of the inline edit.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:dt(t.enabled,this.defaultValue.enabled),showToolbar:Un(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),fontFamily:Co.string(t.fontFamily,this.defaultValue.fontFamily),keepOnBlur:dt(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class h5e extends kn{constructor(){const e={enabled:to.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:to.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:w("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:w("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:dt(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:dt(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class f5e extends kn{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:[w("editor.guides.bracketPairs.true","Enables bracket pair guides."),w("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),w("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:w("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[w("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),w("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),w("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:w("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:w("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:w("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[w("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),w("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),w("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:w("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:z0(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:z0(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:dt(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:dt(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:z0(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function z0(s,e,t){const i=t.indexOf(s);return i===-1?e:t[i]}class g5e extends kn{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(119,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[w("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),w("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:w("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:w("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:w("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:w("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:[w("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),w("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),w("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),w("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:w("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions ({0} and {1}) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.","`#editor.quickSuggestions#`","`#editor.suggestOnTriggerCharacters#`")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:w("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:w("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:w("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:w("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:w("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:w("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:w("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:w("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:w("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:w("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:w("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:Un(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:dt(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:dt(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:dt(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:dt(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:Un(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:dt(t.showIcons,this.defaultValue.showIcons),showStatusBar:dt(t.showStatusBar,this.defaultValue.showStatusBar),preview:dt(t.preview,this.defaultValue.preview),previewMode:Un(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:dt(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:dt(t.showMethods,this.defaultValue.showMethods),showFunctions:dt(t.showFunctions,this.defaultValue.showFunctions),showConstructors:dt(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:dt(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:dt(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:dt(t.showFields,this.defaultValue.showFields),showVariables:dt(t.showVariables,this.defaultValue.showVariables),showClasses:dt(t.showClasses,this.defaultValue.showClasses),showStructs:dt(t.showStructs,this.defaultValue.showStructs),showInterfaces:dt(t.showInterfaces,this.defaultValue.showInterfaces),showModules:dt(t.showModules,this.defaultValue.showModules),showProperties:dt(t.showProperties,this.defaultValue.showProperties),showEvents:dt(t.showEvents,this.defaultValue.showEvents),showOperators:dt(t.showOperators,this.defaultValue.showOperators),showUnits:dt(t.showUnits,this.defaultValue.showUnits),showValues:dt(t.showValues,this.defaultValue.showValues),showConstants:dt(t.showConstants,this.defaultValue.showConstants),showEnums:dt(t.showEnums,this.defaultValue.showEnums),showEnumMembers:dt(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:dt(t.showKeywords,this.defaultValue.showKeywords),showWords:dt(t.showWords,this.defaultValue.showWords),showColors:dt(t.showColors,this.defaultValue.showColors),showFiles:dt(t.showFiles,this.defaultValue.showFiles),showReferences:dt(t.showReferences,this.defaultValue.showReferences),showFolders:dt(t.showFolders,this.defaultValue.showFolders),showTypeParameters:dt(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:dt(t.showSnippets,this.defaultValue.showSnippets),showUsers:dt(t.showUsers,this.defaultValue.showUsers),showIssues:dt(t.showIssues,this.defaultValue.showIssues)}}}class p5e extends kn{constructor(){super(114,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:w("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:w("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:dt(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:dt(e.selectSubwords,this.defaultValue.selectSubwords)}}}class m5e extends kn{constructor(){const e=[];super(131,"wordSegmenterLocales",e,{anyOf:[{description:w("wordSegmenterLocales","Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"string"},{description:w("wordSegmenterLocales","Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"array",items:{type:"string"}}]})}validate(e){if(typeof e=="string"&&(e=[e]),Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="string")try{Intl.Segmenter.supportedLocalesOf(i).length>0&&t.push(i)}catch{}return t}return this.defaultValue}}class _5e extends kn{constructor(){super(139,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[w("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),w("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),w("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),w("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:w("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 v5e extends uN{constructor(){super(147)}compute(e,t,i){const n=t.get(146);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}}class b5e extends kn{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:w("dropIntoEditor.enabled","Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:w("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:[w("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),w("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:dt(t.enabled,this.defaultValue.enabled),showDropSelector:Un(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class C5e extends kn{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(85,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:w("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:w("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:[w("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),w("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:dt(t.enabled,this.defaultValue.enabled),showPasteSelector:Un(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const y5e="Consolas, 'Courier New', monospace",w5e="Menlo, Monaco, 'Courier New', monospace",S5e="'Droid Sans Mono', 'monospace', monospace",Go={fontFamily:ii?w5e:Zo?S5e:y5e,fontWeight:"normal",fontSize:ii?12:14,lineHeight:0,letterSpacing:0},t0=[];function Be(s){return t0[s.id]=s,s}const ju={acceptSuggestionOnCommitCharacter:Be(new bi(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:w("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:Be(new jn(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",w("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:w("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:Be(new O4e),accessibilityPageSize:Be(new sn(3,"accessibilityPageSize",10,1,1073741824,{description:w("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:Be(new Co(4,"ariaLabel",w("editorViewAccessibleLabel","Editor content"))),ariaRequired:Be(new bi(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:Be(new bi(8,"screenReaderAnnounceInlineSuggestion",!0,{description:w("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:Be(new jn(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",w("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),w("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:w("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:Be(new jn(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",w("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),w("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:w("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:Be(new jn(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",w("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:w("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:Be(new jn(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",w("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:w("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:Be(new jn(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",w("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),w("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:w("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:Be(new SA(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],P4e,{enumDescriptions:[w("editor.autoIndent.none","The editor will not insert indentation automatically."),w("editor.autoIndent.keep","The editor will keep the current line's indentation."),w("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),w("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),w("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:w("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:Be(new bi(13,"automaticLayout",!1)),autoSurround:Be(new jn(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[w("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),w("editor.autoSurround.quotes","Surround with quotes but not brackets."),w("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:w("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:Be(new h5e),bracketPairGuides:Be(new f5e),stickyTabStops:Be(new bi(117,"stickyTabStops",!1,{description:w("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:Be(new bi(17,"codeLens",!0,{description:w("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:Be(new Co(18,"codeLensFontFamily","",{description:w("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:Be(new sn(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:w("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:Be(new bi(20,"colorDecorators",!0,{description:w("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:Be(new jn(149,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[w("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),w("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),w("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:w("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:Be(new sn(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:w("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:Be(new bi(22,"columnSelection",!1,{description:w("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:Be(new A4e),contextmenu:Be(new bi(24,"contextmenu",!0)),copyWithSyntaxHighlighting:Be(new bi(25,"copyWithSyntaxHighlighting",!0,{description:w("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:Be(new SA(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],F4e,{description:w("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:Be(new jn(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[w("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),w("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),w("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:w("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:Be(new SA(28,"cursorStyle",wr.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],B4e,{description:w("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:Be(new sn(29,"cursorSurroundingLines",0,0,1073741824,{description:w("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:Be(new jn(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[w("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),w("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:w("cursorSurroundingLinesStyle","Controls when `#editor.cursorSurroundingLines#` should be enforced.")})),cursorWidth:Be(new sn(31,"cursorWidth",0,0,1073741824,{markdownDescription:w("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:Be(new bi(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:Be(new bi(33,"disableMonospaceOptimizations",!1)),domReadOnly:Be(new bi(34,"domReadOnly",!1)),dragAndDrop:Be(new bi(35,"dragAndDrop",!0,{description:w("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:Be(new V4e),dropIntoEditor:Be(new b5e),stickyScroll:Be(new G4e),experimentalWhitespaceRendering:Be(new jn(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[w("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),w("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),w("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:w("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:Be(new Co(39,"extraEditorClassName","")),fastScrollSensitivity:Be(new zl(40,"fastScrollSensitivity",5,s=>s<=0?5:s,{markdownDescription:w("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:Be(new H4e),fixedOverflowWidgets:Be(new bi(42,"fixedOverflowWidgets",!1)),folding:Be(new bi(43,"folding",!0,{description:w("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:Be(new jn(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[w("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),w("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:w("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:Be(new bi(45,"foldingHighlight",!0,{description:w("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:Be(new bi(46,"foldingImportsByDefault",!1,{description:w("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:Be(new sn(47,"foldingMaximumRegions",5e3,10,65e3,{description:w("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:Be(new bi(48,"unfoldOnClickAfterEndOfLine",!1,{description:w("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:Be(new Co(49,"fontFamily",Go.fontFamily,{description:w("fontFamily","Controls the font family.")})),fontInfo:Be(new $4e),fontLigatures2:Be(new e_),fontSize:Be(new z4e),fontWeight:Be(new RU),fontVariations:Be(new yE),formatOnPaste:Be(new bi(55,"formatOnPaste",!1,{description:w("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:Be(new bi(56,"formatOnType",!1,{description:w("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:Be(new bi(57,"glyphMargin",!0,{description:w("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:Be(new j4e),hideCursorInOverviewRuler:Be(new bi(59,"hideCursorInOverviewRuler",!1,{description:w("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:Be(new U4e),inDiffEditor:Be(new bi(61,"inDiffEditor",!1)),letterSpacing:Be(new zl(64,"letterSpacing",Go.letterSpacing,s=>zl.clamp(s,-5,20),{description:w("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:Be(new K4e),lineDecorationsWidth:Be(new Z4e),lineHeight:Be(new X4e),lineNumbers:Be(new r5e),lineNumbersMinChars:Be(new sn(69,"lineNumbersMinChars",5,1,300)),linkedEditing:Be(new bi(70,"linkedEditing",!1,{description:w("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:Be(new bi(71,"links",!0,{description:w("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:Be(new jn(72,"matchBrackets","always",["always","near","never"],{description:w("matchBrackets","Highlight matching brackets.")})),minimap:Be(new Q4e),mouseStyle:Be(new jn(74,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:Be(new zl(75,"mouseWheelScrollSensitivity",1,s=>s===0?1:s,{markdownDescription:w("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:Be(new bi(76,"mouseWheelZoom",!1,{markdownDescription:ii?w("mouseWheelZoom.mac","Zoom the font of the editor when using mouse wheel and holding `Cmd`."):w("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:Be(new bi(77,"multiCursorMergeOverlapping",!0,{description:w("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:Be(new SA(78,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],J4e,{markdownEnumDescriptions:[w("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),w("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:w({key:"multiCursorModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"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:Be(new jn(79,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[w("multiCursorPaste.spread","Each cursor pastes a single line of the text."),w("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:w("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:Be(new sn(80,"multiCursorLimit",1e4,1,1e5,{markdownDescription:w("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:Be(new jn(81,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[w("occurrencesHighlight.off","Does not highlight occurrences."),w("occurrencesHighlight.singleFile","Highlights occurrences only in the current file."),w("occurrencesHighlight.multiFile","Experimental: Highlights occurrences across all valid open files.")],markdownDescription:w("occurrencesHighlight","Controls whether occurrences should be highlighted across open files.")})),overviewRulerBorder:Be(new bi(82,"overviewRulerBorder",!0,{description:w("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:Be(new sn(83,"overviewRulerLanes",3,0,3)),padding:Be(new e5e),pasteAs:Be(new C5e),parameterHints:Be(new t5e),peekWidgetDefaultFocus:Be(new jn(87,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[w("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),w("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:w("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),placeholder:Be(new n5e),definitionLinkOpensInPeek:Be(new bi(89,"definitionLinkOpensInPeek",!1,{description:w("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:Be(new s5e),quickSuggestionsDelay:Be(new sn(91,"quickSuggestionsDelay",10,0,1073741824,{description:w("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:Be(new bi(92,"readOnly",!1)),readOnlyMessage:Be(new a5e),renameOnType:Be(new bi(94,"renameOnType",!1,{description:w("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:w("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:Be(new bi(95,"renderControlCharacters",!0,{description:w("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:Be(new jn(96,"renderFinalNewline",Zo?"dimmed":"on",["off","on","dimmed"],{description:w("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:Be(new jn(97,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",w("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:w("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:Be(new bi(98,"renderLineHighlightOnlyWhenFocus",!1,{description:w("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:Be(new jn(99,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:Be(new jn(100,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",w("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),w("renderWhitespace.selection","Render whitespace characters only on selected text."),w("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:w("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:Be(new sn(101,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:Be(new bi(102,"roundedSelection",!0,{description:w("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:Be(new o5e),scrollbar:Be(new l5e),scrollBeyondLastColumn:Be(new sn(105,"scrollBeyondLastColumn",4,0,1073741824,{description:w("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:Be(new bi(106,"scrollBeyondLastLine",!0,{description:w("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:Be(new bi(107,"scrollPredominantAxis",!0,{description:w("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:Be(new bi(108,"selectionClipboard",!0,{description:w("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:Zo})),selectionHighlight:Be(new bi(109,"selectionHighlight",!0,{description:w("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:Be(new bi(110,"selectOnLineNumbers",!0)),showFoldingControls:Be(new jn(111,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[w("showFoldingControls.always","Always show the folding controls."),w("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),w("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:w("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:Be(new bi(112,"showUnused",!0,{description:w("showUnused","Controls fading out of unused code.")})),showDeprecated:Be(new bi(141,"showDeprecated",!0,{description:w("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:Be(new Y4e),snippetSuggestions:Be(new jn(113,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[w("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),w("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),w("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),w("snippetSuggestions.none","Do not show snippet suggestions.")],description:w("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:Be(new p5e),smoothScrolling:Be(new bi(115,"smoothScrolling",!1,{description:w("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:Be(new sn(118,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:Be(new g5e),inlineSuggest:Be(new d5e),inlineEdit:Be(new u5e),inlineCompletionsAccessibilityVerbose:Be(new bi(150,"inlineCompletionsAccessibilityVerbose",!1,{description:w("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:Be(new sn(120,"suggestFontSize",0,0,1e3,{markdownDescription:w("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:Be(new sn(121,"suggestLineHeight",0,0,1e3,{markdownDescription:w("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:Be(new bi(122,"suggestOnTriggerCharacters",!0,{description:w("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:Be(new jn(123,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[w("suggestSelection.first","Always select the first suggestion."),w("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),w("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:w("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:Be(new jn(124,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[w("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),w("tabCompletion.off","Disable tab completions."),w("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:w("tabCompletion","Enables tab completions.")})),tabIndex:Be(new sn(125,"tabIndex",0,-1,1073741824)),unicodeHighlight:Be(new c5e),unusualLineTerminators:Be(new jn(127,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[w("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),w("unusualLineTerminators.off","Unusual line terminators are ignored."),w("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:w("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:Be(new bi(128,"useShadowDOM",!0)),useTabStops:Be(new bi(129,"useTabStops",!0,{description:w("useTabStops","Spaces and tabs are inserted and deleted in alignment with tab stops.")})),wordBreak:Be(new jn(130,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[w("wordBreak.normal","Use the default line break rule."),w("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:w("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSegmenterLocales:Be(new m5e),wordSeparators:Be(new Co(132,"wordSeparators",d4,{description:w("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:Be(new jn(133,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[w("wordWrap.off","Lines will never wrap."),w("wordWrap.on","Lines will wrap at the viewport width."),w({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),w({key:"wordWrap.bounded",comment:["- viewport means the edge of the visible window size.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:w({key:"wordWrap",comment:["- 'off', 'on', 'wordWrapColumn' and 'bounded' refer to values the setting can take and should not be localized.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:Be(new Co(134,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:Be(new Co(135,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:Be(new sn(136,"wordWrapColumn",80,1,1073741824,{markdownDescription:w({key:"wordWrapColumn",comment:["- `editor.wordWrap` refers to a different setting and should not be localized.","- 'wordWrapColumn' and 'bounded' refer to values the different setting can take and should not be localized."]},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:Be(new jn(137,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:Be(new jn(138,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:Be(new W4e),defaultColorDecorators:Be(new bi(148,"defaultColorDecorators",!1,{markdownDescription:w("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:Be(new i5e),tabFocusMode:Be(new bi(145,"tabFocusMode",!1,{markdownDescription:w("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:Be(new $0),wrappingInfo:Be(new v5e),wrappingIndent:Be(new _5e),wrappingStrategy:Be(new q4e)};class x5e{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?ES.isErrorNoTelemetry(e)?new ES(e.message+`
|
|
@@ -864,27 +864,27 @@ ${e.toString()}`}}class M5{constructor(e=new jx,t=!1,i,n=kGe){this._services=e,t
|
|
|
864
864
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
865
865
|
* Released under the MIT license
|
|
866
866
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
867
|
-
*-----------------------------------------------------------------------------*/var Ntt=Object.defineProperty,Mtt=Object.getOwnPropertyDescriptor,Rtt=Object.getOwnPropertyNames,Ptt=Object.prototype.hasOwnProperty,Ott=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Rtt(e))!Ptt.call(s,n)&&n!==t&&Ntt(s,n,{get:()=>e[n],enumerable:!(i=Mtt(e,n))||i.enumerable});return s},Att=(s,e,t)=>(Ott(s,e,"default"),t),jD={};Att(jD,VN);var J1e={},cj={},Ftt=class e0e{static getOrCreate(e){return cj[e]||(cj[e]=new e0e(e)),cj[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,J1e[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function vt(s){const e=s.id;J1e[e]=s,jD.languages.register(s);const t=Ftt.getOrCreate(e);jD.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),jD.languages.onLanguageEncountered(e,async()=>{const i=await t.load();jD.languages.setLanguageConfiguration(e,i.conf)})}vt({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>ot(()=>import("./abap-BrgZPUOV.js"),[])});vt({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>ot(()=>import("./apex-DyP6w7ZV.js"),[])});vt({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>ot(()=>import("./azcli-BaLxmfj-.js"),[])});vt({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>ot(()=>import("./bat-CFOPXBzS.js"),[])});vt({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>ot(()=>import("./bicep-BfEKNvv3.js"),[])});vt({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>ot(()=>import("./cameligo-BFG1Mk7z.js"),[])});vt({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>ot(()=>import("./clojure-DTECt2xU.js"),[])});vt({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>ot(()=>import("./coffee-CDGzqUPQ.js"),[])});vt({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>ot(()=>import("./cpp-CLLBncYj.js"),[])});vt({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>ot(()=>import("./cpp-CLLBncYj.js"),[])});vt({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>ot(()=>import("./csharp-dUCx_-0o.js"),[])});vt({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>ot(()=>import("./csp-5Rap-vPy.js"),[])});vt({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>ot(()=>import("./css-D3h14YRZ.js"),[])});vt({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>ot(()=>import("./cypher-DrQuvNYM.js"),[])});vt({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>ot(()=>import("./dart-CFKIUWau.js"),[])});vt({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>ot(()=>import("./dockerfile-Zznr-cwX.js"),[])});vt({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>ot(()=>import("./ecl-Ce3n6wWz.js"),[])});vt({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>ot(()=>import("./elixir-deUWdS0T.js"),[])});vt({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>ot(()=>import("./flow9-i9-g7ZhI.js"),[])});vt({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>ot(()=>import("./fsharp-CzKuDChf.js"),[])});vt({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>ot(()=>import("./freemarker2-DTyAQBBj.js"),[]).then(s=>s.TagAutoInterpolationDollar)});vt({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>ot(()=>import("./freemarker2-DTyAQBBj.js"),[]).then(s=>s.TagAngleInterpolationDollar)});vt({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>ot(()=>import("./freemarker2-DTyAQBBj.js"),[]).then(s=>s.TagBracketInterpolationDollar)});vt({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>ot(()=>import("./freemarker2-DTyAQBBj.js"),[]).then(s=>s.TagAngleInterpolationBracket)});vt({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>ot(()=>import("./freemarker2-DTyAQBBj.js"),[]).then(s=>s.TagBracketInterpolationBracket)});vt({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>ot(()=>import("./freemarker2-DTyAQBBj.js"),[]).then(s=>s.TagAutoInterpolationDollar)});vt({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>ot(()=>import("./freemarker2-DTyAQBBj.js"),[]).then(s=>s.TagAutoInterpolationBracket)});vt({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>ot(()=>import("./go-Cphgjts3.js"),[])});vt({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>ot(()=>import("./graphql-Cg7bfA9N.js"),[])});vt({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>ot(()=>import("./handlebars-DiWIXxOG.js"),[])});vt({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>ot(()=>import("./hcl-0cvrggvQ.js"),[])});vt({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:()=>ot(()=>import("./html-BCQWkFzH.js"),[])});vt({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>ot(()=>import("./ini-Drc7WvVn.js"),[])});vt({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>ot(()=>import("./java-B_fMsGYe.js"),[])});vt({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>ot(()=>import("./javascript-By4MYHaO.js"),__vite__mapDeps([0,1]))});vt({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>ot(()=>import("./julia-Bqgm2twL.js"),[])});vt({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>ot(()=>import("./kotlin-BSkB5QuD.js"),[])});vt({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>ot(()=>import("./less-BsTHnhdd.js"),[])});vt({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>ot(()=>import("./lexon-YWi4-JPR.js"),[])});vt({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>ot(()=>import("./lua-nf6ki56Z.js"),[])});vt({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>ot(()=>import("./liquid-BQBVii4f.js"),[])});vt({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>ot(()=>import("./m3-Cpb6xl2v.js"),[])});vt({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>ot(()=>import("./markdown-DSZPf7rp.js"),[])});vt({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>ot(()=>import("./mdx-Cwk7nqzM.js"),[])});vt({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>ot(()=>import("./mips-B_c3zf-v.js"),[])});vt({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>ot(()=>import("./msdax-rUNN04Wq.js"),[])});vt({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>ot(()=>import("./mysql-DDwshQtU.js"),[])});vt({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>ot(()=>import("./objective-c-B5zXfXm9.js"),[])});vt({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>ot(()=>import("./pascal-CXOwvkN_.js"),[])});vt({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>ot(()=>import("./pascaligo-Bc-ZgV77.js"),[])});vt({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>ot(()=>import("./perl-CwNk8-XU.js"),[])});vt({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>ot(()=>import("./pgsql-tGk8EFnU.js"),[])});vt({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>ot(()=>import("./php-CpIb_Oan.js"),[])});vt({id:"pla",extensions:[".pla"],loader:()=>ot(()=>import("./pla-B03wrqEc.js"),[])});vt({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>ot(()=>import("./postiats-BKlk5iyT.js"),[])});vt({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>ot(()=>import("./powerquery-Bhzvs7bI.js"),[])});vt({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>ot(()=>import("./powershell-Dd3NCNK9.js"),[])});vt({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>ot(()=>import("./protobuf-COyEY5Pt.js"),[])});vt({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>ot(()=>import("./pug-BaJupSGV.js"),[])});vt({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>ot(()=>import("./python-L_kGfe1T.js"),[])});vt({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>ot(()=>import("./qsharp-DXyYeYxl.js"),[])});vt({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>ot(()=>import("./r-CdQndTaG.js"),[])});vt({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>ot(()=>import("./razor-XGuHliMI.js"),[])});vt({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>ot(()=>import("./redis-CVwtpugi.js"),[])});vt({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>ot(()=>import("./redshift-25W9uPmb.js"),[])});vt({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>ot(()=>import("./restructuredtext-DfzH4Xui.js"),[])});vt({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>ot(()=>import("./ruby-Cp1zYvxS.js"),[])});vt({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>ot(()=>import("./rust-D5C2fndG.js"),[])});vt({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>ot(()=>import("./sb-CDntyWJ8.js"),[])});vt({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:()=>ot(()=>import("./scala-BoFRg7Ot.js"),[])});vt({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>ot(()=>import("./scheme-Bio4gycK.js"),[])});vt({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>ot(()=>import("./scss-4Ik7cdeQ.js"),[])});vt({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>ot(()=>import("./shell-CX-rkNHf.js"),[])});vt({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>ot(()=>import("./solidity-Tw7wswEv.js"),[])});vt({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>ot(()=>import("./sophia-C5WLch3f.js"),[])});vt({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>ot(()=>import("./sparql-DHaeiCBh.js"),[])});vt({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>ot(()=>import("./sql-CCSDG5nI.js"),[])});vt({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>ot(()=>import("./st-pnP8ivHi.js"),[])});vt({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>ot(()=>import("./swift-DwJ7jVG9.js"),[])});vt({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>ot(()=>import("./systemverilog-B9Xyijhd.js"),[])});vt({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>ot(()=>import("./systemverilog-B9Xyijhd.js"),[])});vt({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>ot(()=>import("./tcl-DnHyzjbg.js"),[])});vt({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>ot(()=>import("./twig-CPajHgWi.js"),[])});vt({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>ot(()=>import("./typescript-DJcyqRjT.js"),[])});vt({id:"typespec",extensions:[".tsp"],aliases:["TypeSpec"],loader:()=>ot(()=>import("./typespec-D-MeaMDU.js"),[])});vt({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>ot(()=>import("./vb-DgyLZaXg.js"),[])});vt({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>ot(()=>import("./wgsl-BIv9DU6q.js"),[])});vt({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:()=>ot(()=>import("./xml-DQgCzk55.js"),[])});vt({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>ot(()=>import("./yaml-DBdEYBPA.js"),[])});/*!-----------------------------------------------------------------------------
|
|
867
|
+
*-----------------------------------------------------------------------------*/var Ntt=Object.defineProperty,Mtt=Object.getOwnPropertyDescriptor,Rtt=Object.getOwnPropertyNames,Ptt=Object.prototype.hasOwnProperty,Ott=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Rtt(e))!Ptt.call(s,n)&&n!==t&&Ntt(s,n,{get:()=>e[n],enumerable:!(i=Mtt(e,n))||i.enumerable});return s},Att=(s,e,t)=>(Ott(s,e,"default"),t),jD={};Att(jD,VN);var J1e={},cj={},Ftt=class e0e{static getOrCreate(e){return cj[e]||(cj[e]=new e0e(e)),cj[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,J1e[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function vt(s){const e=s.id;J1e[e]=s,jD.languages.register(s);const t=Ftt.getOrCreate(e);jD.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),jD.languages.onLanguageEncountered(e,async()=>{const i=await t.load();jD.languages.setLanguageConfiguration(e,i.conf)})}vt({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>ot(()=>import("./abap-BrgZPUOV.js"),[])});vt({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>ot(()=>import("./apex-DyP6w7ZV.js"),[])});vt({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>ot(()=>import("./azcli-BaLxmfj-.js"),[])});vt({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>ot(()=>import("./bat-CFOPXBzS.js"),[])});vt({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>ot(()=>import("./bicep-BfEKNvv3.js"),[])});vt({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>ot(()=>import("./cameligo-BFG1Mk7z.js"),[])});vt({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>ot(()=>import("./clojure-DTECt2xU.js"),[])});vt({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>ot(()=>import("./coffee-CDGzqUPQ.js"),[])});vt({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>ot(()=>import("./cpp-CLLBncYj.js"),[])});vt({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>ot(()=>import("./cpp-CLLBncYj.js"),[])});vt({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>ot(()=>import("./csharp-dUCx_-0o.js"),[])});vt({id:"csp",extensions:[".csp"],aliases:["CSP","csp"],loader:()=>ot(()=>import("./csp-5Rap-vPy.js"),[])});vt({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>ot(()=>import("./css-D3h14YRZ.js"),[])});vt({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>ot(()=>import("./cypher-DrQuvNYM.js"),[])});vt({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>ot(()=>import("./dart-CFKIUWau.js"),[])});vt({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>ot(()=>import("./dockerfile-Zznr-cwX.js"),[])});vt({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>ot(()=>import("./ecl-Ce3n6wWz.js"),[])});vt({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>ot(()=>import("./elixir-deUWdS0T.js"),[])});vt({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>ot(()=>import("./flow9-i9-g7ZhI.js"),[])});vt({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>ot(()=>import("./fsharp-CzKuDChf.js"),[])});vt({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>ot(()=>import("./freemarker2-CX3jc3l2.js"),[]).then(s=>s.TagAutoInterpolationDollar)});vt({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>ot(()=>import("./freemarker2-CX3jc3l2.js"),[]).then(s=>s.TagAngleInterpolationDollar)});vt({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>ot(()=>import("./freemarker2-CX3jc3l2.js"),[]).then(s=>s.TagBracketInterpolationDollar)});vt({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>ot(()=>import("./freemarker2-CX3jc3l2.js"),[]).then(s=>s.TagAngleInterpolationBracket)});vt({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>ot(()=>import("./freemarker2-CX3jc3l2.js"),[]).then(s=>s.TagBracketInterpolationBracket)});vt({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>ot(()=>import("./freemarker2-CX3jc3l2.js"),[]).then(s=>s.TagAutoInterpolationDollar)});vt({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>ot(()=>import("./freemarker2-CX3jc3l2.js"),[]).then(s=>s.TagAutoInterpolationBracket)});vt({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>ot(()=>import("./go-Cphgjts3.js"),[])});vt({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>ot(()=>import("./graphql-Cg7bfA9N.js"),[])});vt({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>ot(()=>import("./handlebars-CTaQD6FN.js"),[])});vt({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>ot(()=>import("./hcl-0cvrggvQ.js"),[])});vt({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:()=>ot(()=>import("./html-BruJsfYv.js"),[])});vt({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>ot(()=>import("./ini-Drc7WvVn.js"),[])});vt({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>ot(()=>import("./java-B_fMsGYe.js"),[])});vt({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>ot(()=>import("./javascript-B4ku8P1-.js"),__vite__mapDeps([0,1]))});vt({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>ot(()=>import("./julia-Bqgm2twL.js"),[])});vt({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>ot(()=>import("./kotlin-BSkB5QuD.js"),[])});vt({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>ot(()=>import("./less-BsTHnhdd.js"),[])});vt({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>ot(()=>import("./lexon-YWi4-JPR.js"),[])});vt({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>ot(()=>import("./lua-nf6ki56Z.js"),[])});vt({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>ot(()=>import("./liquid-Bo3G0Ep7.js"),[])});vt({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>ot(()=>import("./m3-Cpb6xl2v.js"),[])});vt({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>ot(()=>import("./markdown-DSZPf7rp.js"),[])});vt({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>ot(()=>import("./mdx-Duv0ylZz.js"),[])});vt({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>ot(()=>import("./mips-B_c3zf-v.js"),[])});vt({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>ot(()=>import("./msdax-rUNN04Wq.js"),[])});vt({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>ot(()=>import("./mysql-DDwshQtU.js"),[])});vt({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>ot(()=>import("./objective-c-B5zXfXm9.js"),[])});vt({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>ot(()=>import("./pascal-CXOwvkN_.js"),[])});vt({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>ot(()=>import("./pascaligo-Bc-ZgV77.js"),[])});vt({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>ot(()=>import("./perl-CwNk8-XU.js"),[])});vt({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>ot(()=>import("./pgsql-tGk8EFnU.js"),[])});vt({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>ot(()=>import("./php-CpIb_Oan.js"),[])});vt({id:"pla",extensions:[".pla"],loader:()=>ot(()=>import("./pla-B03wrqEc.js"),[])});vt({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>ot(()=>import("./postiats-BKlk5iyT.js"),[])});vt({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>ot(()=>import("./powerquery-Bhzvs7bI.js"),[])});vt({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>ot(()=>import("./powershell-Dd3NCNK9.js"),[])});vt({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>ot(()=>import("./protobuf-COyEY5Pt.js"),[])});vt({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>ot(()=>import("./pug-BaJupSGV.js"),[])});vt({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>ot(()=>import("./python-CEhCctGm.js"),[])});vt({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>ot(()=>import("./qsharp-DXyYeYxl.js"),[])});vt({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>ot(()=>import("./r-CdQndTaG.js"),[])});vt({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>ot(()=>import("./razor-DPK8nTD7.js"),[])});vt({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>ot(()=>import("./redis-CVwtpugi.js"),[])});vt({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>ot(()=>import("./redshift-25W9uPmb.js"),[])});vt({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>ot(()=>import("./restructuredtext-DfzH4Xui.js"),[])});vt({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>ot(()=>import("./ruby-Cp1zYvxS.js"),[])});vt({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>ot(()=>import("./rust-D5C2fndG.js"),[])});vt({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>ot(()=>import("./sb-CDntyWJ8.js"),[])});vt({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:()=>ot(()=>import("./scala-BoFRg7Ot.js"),[])});vt({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>ot(()=>import("./scheme-Bio4gycK.js"),[])});vt({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>ot(()=>import("./scss-4Ik7cdeQ.js"),[])});vt({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>ot(()=>import("./shell-CX-rkNHf.js"),[])});vt({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>ot(()=>import("./solidity-Tw7wswEv.js"),[])});vt({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>ot(()=>import("./sophia-C5WLch3f.js"),[])});vt({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>ot(()=>import("./sparql-DHaeiCBh.js"),[])});vt({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>ot(()=>import("./sql-CCSDG5nI.js"),[])});vt({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>ot(()=>import("./st-pnP8ivHi.js"),[])});vt({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>ot(()=>import("./swift-DwJ7jVG9.js"),[])});vt({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>ot(()=>import("./systemverilog-B9Xyijhd.js"),[])});vt({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>ot(()=>import("./systemverilog-B9Xyijhd.js"),[])});vt({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>ot(()=>import("./tcl-DnHyzjbg.js"),[])});vt({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>ot(()=>import("./twig-CPajHgWi.js"),[])});vt({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>ot(()=>import("./typescript-CmEn-k1B.js"),[])});vt({id:"typespec",extensions:[".tsp"],aliases:["TypeSpec"],loader:()=>ot(()=>import("./typespec-D-MeaMDU.js"),[])});vt({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>ot(()=>import("./vb-DgyLZaXg.js"),[])});vt({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>ot(()=>import("./wgsl-BIv9DU6q.js"),[])});vt({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:()=>ot(()=>import("./xml-bjvdKeyy.js"),[])});vt({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>ot(()=>import("./yaml-N5RXWxJk.js"),[])});/*!-----------------------------------------------------------------------------
|
|
868
868
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
869
869
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
870
870
|
* Released under the MIT license
|
|
871
871
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
872
|
-
*-----------------------------------------------------------------------------*/var Btt=Object.defineProperty,Wtt=Object.getOwnPropertyDescriptor,Vtt=Object.getOwnPropertyNames,Htt=Object.prototype.hasOwnProperty,$tt=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Vtt(e))!Htt.call(s,n)&&n!==t&&Btt(s,n,{get:()=>e[n],enumerable:!(i=Wtt(e,n))||i.enumerable});return s},ztt=(s,e,t)=>($tt(s,e,"default"),t),Kx={};ztt(Kx,VN);var ine=class{constructor(e,t,i){this._onDidChange=new Kx.Emitter,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)}},nne={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}},sne={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},t0e=new ine("css",nne,sne),i0e=new ine("scss",nne,sne),n0e=new ine("less",nne,sne);Kx.languages.css={cssDefaults:t0e,lessDefaults:n0e,scssDefaults:i0e};function rne(){return ot(()=>import("./cssMode-
|
|
872
|
+
*-----------------------------------------------------------------------------*/var Btt=Object.defineProperty,Wtt=Object.getOwnPropertyDescriptor,Vtt=Object.getOwnPropertyNames,Htt=Object.prototype.hasOwnProperty,$tt=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Vtt(e))!Htt.call(s,n)&&n!==t&&Btt(s,n,{get:()=>e[n],enumerable:!(i=Wtt(e,n))||i.enumerable});return s},ztt=(s,e,t)=>($tt(s,e,"default"),t),Kx={};ztt(Kx,VN);var ine=class{constructor(e,t,i){this._onDidChange=new Kx.Emitter,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)}},nne={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}},sne={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},t0e=new ine("css",nne,sne),i0e=new ine("scss",nne,sne),n0e=new ine("less",nne,sne);Kx.languages.css={cssDefaults:t0e,lessDefaults:n0e,scssDefaults:i0e};function rne(){return ot(()=>import("./cssMode-CBb6D87U.js"),[])}Kx.languages.onLanguage("less",()=>{rne().then(s=>s.setupMode(n0e))});Kx.languages.onLanguage("scss",()=>{rne().then(s=>s.setupMode(i0e))});Kx.languages.onLanguage("css",()=>{rne().then(s=>s.setupMode(t0e))});/*!-----------------------------------------------------------------------------
|
|
873
873
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
874
874
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
875
875
|
* Released under the MIT license
|
|
876
876
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
877
|
-
*-----------------------------------------------------------------------------*/var jtt=Object.defineProperty,Utt=Object.getOwnPropertyDescriptor,qtt=Object.getOwnPropertyNames,Ktt=Object.prototype.hasOwnProperty,Gtt=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qtt(e))!Ktt.call(s,n)&&n!==t&&jtt(s,n,{get:()=>e[n],enumerable:!(i=Utt(e,n))||i.enumerable});return s},Ytt=(s,e,t)=>(Gtt(s,e,"default"),t),TH={};Ytt(TH,VN);var Ztt=class{constructor(e,t,i){this._onDidChange=new TH.Emitter,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)}},Xtt={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"},NH={format:Xtt,suggest:{},data:{useDefaultDataProvider:!0}};function MH(s){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:s===RI,documentFormattingEdits:s===RI,documentRangeFormattingEdits:s===RI}}var RI="html",zfe="handlebars",jfe="razor",s0e=RH(RI,NH,MH(RI)),Qtt=s0e.defaults,r0e=RH(zfe,NH,MH(zfe)),Jtt=r0e.defaults,o0e=RH(jfe,NH,MH(jfe)),eit=o0e.defaults;TH.languages.html={htmlDefaults:Qtt,razorDefaults:eit,handlebarDefaults:Jtt,htmlLanguageService:s0e,handlebarLanguageService:r0e,razorLanguageService:o0e,registerHTMLLanguageService:RH};function tit(){return ot(()=>import("./htmlMode-
|
|
877
|
+
*-----------------------------------------------------------------------------*/var jtt=Object.defineProperty,Utt=Object.getOwnPropertyDescriptor,qtt=Object.getOwnPropertyNames,Ktt=Object.prototype.hasOwnProperty,Gtt=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qtt(e))!Ktt.call(s,n)&&n!==t&&jtt(s,n,{get:()=>e[n],enumerable:!(i=Utt(e,n))||i.enumerable});return s},Ytt=(s,e,t)=>(Gtt(s,e,"default"),t),TH={};Ytt(TH,VN);var Ztt=class{constructor(e,t,i){this._onDidChange=new TH.Emitter,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)}},Xtt={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"},NH={format:Xtt,suggest:{},data:{useDefaultDataProvider:!0}};function MH(s){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:s===RI,documentFormattingEdits:s===RI,documentRangeFormattingEdits:s===RI}}var RI="html",zfe="handlebars",jfe="razor",s0e=RH(RI,NH,MH(RI)),Qtt=s0e.defaults,r0e=RH(zfe,NH,MH(zfe)),Jtt=r0e.defaults,o0e=RH(jfe,NH,MH(jfe)),eit=o0e.defaults;TH.languages.html={htmlDefaults:Qtt,razorDefaults:eit,handlebarDefaults:Jtt,htmlLanguageService:s0e,handlebarLanguageService:r0e,razorLanguageService:o0e,registerHTMLLanguageService:RH};function tit(){return ot(()=>import("./htmlMode-wewroXLr.js"),[])}function RH(s,e=NH,t=MH(s)){const i=new Ztt(s,e,t);let n;const r=TH.languages.onLanguage(s,async()=>{n=(await tit()).setupMode(i)});return{defaults:i,dispose(){r.dispose(),n==null||n.dispose(),n=void 0}}}/*!-----------------------------------------------------------------------------
|
|
878
878
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
879
879
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
880
880
|
* Released under the MIT license
|
|
881
881
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
882
|
-
*-----------------------------------------------------------------------------*/var iit=Object.defineProperty,nit=Object.getOwnPropertyDescriptor,sit=Object.getOwnPropertyNames,rit=Object.prototype.hasOwnProperty,oit=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of sit(e))!rit.call(s,n)&&n!==t&&iit(s,n,{get:()=>e[n],enumerable:!(i=nit(e,n))||i.enumerable});return s},ait=(s,e,t)=>(oit(s,e,"default"),t),HN={};ait(HN,VN);var lit=class{constructor(e,t,i){this._onDidChange=new HN.Emitter,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)}},cit={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},dit={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},a0e=new lit("json",cit,dit),uit=()=>l0e().then(s=>s.getWorker());HN.languages.json={jsonDefaults:a0e,getWorker:uit};function l0e(){return ot(()=>import("./jsonMode-
|
|
882
|
+
*-----------------------------------------------------------------------------*/var iit=Object.defineProperty,nit=Object.getOwnPropertyDescriptor,sit=Object.getOwnPropertyNames,rit=Object.prototype.hasOwnProperty,oit=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of sit(e))!rit.call(s,n)&&n!==t&&iit(s,n,{get:()=>e[n],enumerable:!(i=nit(e,n))||i.enumerable});return s},ait=(s,e,t)=>(oit(s,e,"default"),t),HN={};ait(HN,VN);var lit=class{constructor(e,t,i){this._onDidChange=new HN.Emitter,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)}},cit={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},dit={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},a0e=new lit("json",cit,dit),uit=()=>l0e().then(s=>s.getWorker());HN.languages.json={jsonDefaults:a0e,getWorker:uit};function l0e(){return ot(()=>import("./jsonMode-BIvVuBMG.js"),[])}HN.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});HN.languages.onLanguage("json",()=>{l0e().then(s=>s.setupMode(a0e))});/*!-----------------------------------------------------------------------------
|
|
883
883
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
884
884
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
885
885
|
* Released under the MIT license
|
|
886
886
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
887
|
-
*-----------------------------------------------------------------------------*/var hit=Object.defineProperty,fit=Object.getOwnPropertyDescriptor,git=Object.getOwnPropertyNames,pit=Object.prototype.hasOwnProperty,mit=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of git(e))!pit.call(s,n)&&n!==t&&hit(s,n,{get:()=>e[n],enumerable:!(i=fit(e,n))||i.enumerable});return s},_it=(s,e,t)=>(mit(s,e,"default"),t),vit="5.4.5",tx={};_it(tx,VN);var c0e=(s=>(s[s.None=0]="None",s[s.CommonJS=1]="CommonJS",s[s.AMD=2]="AMD",s[s.UMD=3]="UMD",s[s.System=4]="System",s[s.ES2015=5]="ES2015",s[s.ESNext=99]="ESNext",s))(c0e||{}),d0e=(s=>(s[s.None=0]="None",s[s.Preserve=1]="Preserve",s[s.React=2]="React",s[s.ReactNative=3]="ReactNative",s[s.ReactJSX=4]="ReactJSX",s[s.ReactJSXDev=5]="ReactJSXDev",s))(d0e||{}),u0e=(s=>(s[s.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",s[s.LineFeed=1]="LineFeed",s))(u0e||{}),h0e=(s=>(s[s.ES3=0]="ES3",s[s.ES5=1]="ES5",s[s.ES2015=2]="ES2015",s[s.ES2016=3]="ES2016",s[s.ES2017=4]="ES2017",s[s.ES2018=5]="ES2018",s[s.ES2019=6]="ES2019",s[s.ES2020=7]="ES2020",s[s.ESNext=99]="ESNext",s[s.JSON=100]="JSON",s[s.Latest=99]="Latest",s))(h0e||{}),f0e=(s=>(s[s.Classic=1]="Classic",s[s.NodeJs=2]="NodeJs",s))(f0e||{}),g0e=class{constructor(s,e,t,i,n){this._onDidChange=new tx.Emitter,this._onDidExtraLibsChange=new tx.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(s),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(s,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===s)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:s,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(s){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),s&&s.length>0)for(const e of s){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(s){this._compilerOptions=s||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(s){this._diagnosticsOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(s){this._workerOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(s){this._inlayHintsOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(s){}setEagerModelSync(s){this._eagerModelSync=s}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(s){this._modeConfiguration=s||Object.create(null),this._onDidChange.fire(void 0)}},bit=vit,p0e={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},m0e=new g0e({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},p0e),_0e=new g0e({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},p0e),Cit=()=>PH().then(s=>s.getTypeScriptWorker()),yit=()=>PH().then(s=>s.getJavaScriptWorker());tx.languages.typescript={ModuleKind:c0e,JsxEmit:d0e,NewLineKind:u0e,ScriptTarget:h0e,ModuleResolutionKind:f0e,typescriptVersion:bit,typescriptDefaults:m0e,javascriptDefaults:_0e,getTypeScriptWorker:Cit,getJavaScriptWorker:yit};function PH(){return ot(()=>import("./tsMode-SuiD3mJa.js"),[])}tx.languages.onLanguage("typescript",()=>PH().then(s=>s.setupTypeScript(m0e)));tx.languages.onLanguage("javascript",()=>PH().then(s=>s.setupJavaScript(_0e)));class wit extends ta{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:Lt("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:Oe.map,toggled:ve.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ve.has("isInDiffEditor"),menu:{when:ve.has("isInDiffEditor"),id:rt.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Gt),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class v0e extends ta{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:Lt("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:ve.has("isInDiffEditor")})}run(e,...t){const i=e.get(Gt),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class b0e extends ta{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:Lt("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:ve.has("isInDiffEditor")})}run(e,...t){const i=e.get(Gt),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const $N=Lt("diffEditor","Diff Editor");class Sit extends Uu{constructor(){super({id:"diffEditor.switchSide",title:Lt("switchSide","Switch Side"),icon:Oe.arrowSwap,precondition:ve.has("isInDiffEditor"),f1:!0,category:$N})}runEditorCommand(e,t,i){const n=Gx(e);if(n instanceof Vg){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class xit extends Uu{constructor(){super({id:"diffEditor.exitCompareMove",title:Lt("exitCompareMove","Exit Compare Move"),icon:Oe.close,precondition:U.comparingMovedCode,f1:!1,category:$N,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Gx(e);n instanceof Vg&&n.exitCompareMove()}}class kit extends Uu{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Lt("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:Oe.fold,precondition:ve.has("isInDiffEditor"),f1:!0,category:$N})}runEditorCommand(e,t,...i){const n=Gx(e);n instanceof Vg&&n.collapseAllUnchangedRegions()}}class Lit extends Uu{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Lt("showAllUnchangedRegions","Show All Unchanged Regions"),icon:Oe.unfold,precondition:ve.has("isInDiffEditor"),f1:!0,category:$N})}runEditorCommand(e,t,...i){const n=Gx(e);n instanceof Vg&&n.showAllUnchangedRegions()}}class gZ extends ta{constructor(){super({id:"diffEditor.revert",title:Lt("revert","Revert"),f1:!1,category:$N})}run(e,t){const i=Dit(e,t.originalUri,t.modifiedUri);i instanceof Vg&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const C0e=Lt("accessibleDiffViewer","Accessible Diff Viewer"),iW=class iW extends ta{constructor(){super({id:iW.id,title:Lt("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:C0e,precondition:ve.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=Gx(e);t==null||t.accessibleDiffViewerNext()}};iW.id="editor.action.accessibleDiffViewer.next";let xT=iW;const nW=class nW extends ta{constructor(){super({id:nW.id,title:Lt("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:C0e,precondition:ve.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=Gx(e);t==null||t.accessibleDiffViewerPrev()}};nW.id="editor.action.accessibleDiffViewer.prev";let c3=nW;function Dit(s,e,t){return s.get(wi).listDiffEditors().find(r=>{var l,d;const o=r.getModifiedEditor(),a=r.getOriginalEditor();return o&&((l=o.getModel())==null?void 0:l.uri.toString())===t.toString()&&a&&((d=a.getModel())==null?void 0:d.uri.toString())===e.toString()})||null}function Gx(s){const t=s.get(wi).listDiffEditors(),i=jr();if(i)for(const n of t){const r=n.getContainerDomNode();if(Iit(r,i))return n}return null}function Iit(s,e){let t=e;for(;t;){if(t===s)return!0;t=t.parentElement}return!1}on(wit);on(v0e);on(b0e);lr.appendMenuItem(rt.EditorTitle,{command:{id:new b0e().desc.id,title:w("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:ve.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ve.has("isInDiffEditor")},order:11,group:"1_diff",when:ve.and(U.diffEditorRenderSideBySideInlineBreakpointReached,ve.has("isInDiffEditor"))});lr.appendMenuItem(rt.EditorTitle,{command:{id:new v0e().desc.id,title:w("showMoves","Show Moved Code Blocks"),icon:Oe.move,toggled:Tx.create("config.diffEditor.experimental.showMoves",!0),precondition:ve.has("isInDiffEditor")},order:10,group:"1_diff",when:ve.has("isInDiffEditor")});on(gZ);for(const s of[{icon:Oe.arrowRight,key:U.diffEditorInlineMode.toNegated()},{icon:Oe.discard,key:U.diffEditorInlineMode}])lr.appendMenuItem(rt.DiffEditorHunkToolbar,{command:{id:new gZ().desc.id,title:w("revertHunk","Revert Block"),icon:s.icon},when:ve.and(U.diffEditorModifiedWritable,s.key),order:5,group:"primary"}),lr.appendMenuItem(rt.DiffEditorSelectionToolbar,{command:{id:new gZ().desc.id,title:w("revertSelection","Revert Selection"),icon:s.icon},when:ve.and(U.diffEditorModifiedWritable,s.key),order:5,group:"primary"});on(Sit);on(xit);on(kit);on(Lit);lr.appendMenuItem(rt.EditorTitle,{command:{id:xT.id,title:w("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:ve.has("isInDiffEditor")},order:10,group:"2_diff",when:ve.and(U.accessibleDiffViewerVisible.negate(),ve.has("isInDiffEditor"))});fi.registerCommandAlias("editor.action.diffReview.next",xT.id);on(xT);fi.registerCommandAlias("editor.action.diffReview.prev",c3.id);on(c3);var Eit=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Tit=function(s,e){return function(t,i){e(t,i,s)}},pZ;const OH=new qe("selectionAnchorSet",!1);var tC;let __=(tC=class{static get(e){return e.getContribution(pZ.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=OH.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(lt.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new io().appendText(w("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Jo(w("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(lt.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()}},pZ=tC,tC.ID="editor.contrib.selectionAnchorController",tC);__=pZ=Eit([Tit(1,wt)],__);class Nit extends Xe{constructor(){super({id:"editor.action.setSelectionAnchor",label:w("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:Ds(2089,2080),weight:100}})}async run(e,t){var i;(i=__.get(t))==null||i.setSelectionAnchor()}}class Mit extends Xe{constructor(){super({id:"editor.action.goToSelectionAnchor",label:w("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:OH})}async run(e,t){var i;(i=__.get(t))==null||i.goToSelectionAnchor()}}class Rit extends Xe{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:w("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:OH,kbOpts:{kbExpr:U.editorTextFocus,primary:Ds(2089,2089),weight:100}})}async run(e,t){var i;(i=__.get(t))==null||i.selectFromAnchorToCursor()}}class Pit extends Xe{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:w("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:OH,kbOpts:{kbExpr:U.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=__.get(t))==null||i.cancelSelectionAnchor()}}pi(__.ID,__,4);Pe(Nit);Pe(Mit);Pe(Rit);Pe(Pit);const Oit=q("editorOverviewRuler.bracketMatchForeground","#A0A0A0",w("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class Ait extends Xe{constructor(){super({id:"editor.action.jumpToBracket",label:w("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=dy.get(t))==null||i.jumpToBracket()}}class Fit extends Xe{constructor(){super({id:"editor.action.selectToBracket",label:w("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:Lt("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 r;let n=!0;i&&i.selectBrackets===!1&&(n=!1),(r=dy.get(t))==null||r.selectToBracket(n)}}class Bit extends Xe{constructor(){super({id:"editor.action.removeBrackets",label:w("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=dy.get(t))==null||i.removeBrackets(this.id)}}class Wit{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const Up=class Up extends re{static get(e){return e.getContribution(Up.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Ui(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),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(72)&&(this._matchBrackets=this._editor.getOption(72),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(),r=e.bracketPairs.matchBracket(n);let o=null;if(r)r[0].containsPosition(n)&&!r[1].containsPosition(n)?o=r[1].getStartPosition():r[1].containsPosition(n)&&(o=r[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)o=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(n);l&&l.range&&(o=l.range.getStartPosition())}}return o?new lt(o.lineNumber,o.column,o.lineNumber,o.column):new lt(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 r=n.getStartPosition();let o=t.bracketPairs.matchBracket(r);if(!o&&(o=t.bracketPairs.findEnclosingBrackets(r),!o)){const d=t.bracketPairs.findNextBracket(r);d&&d.range&&(o=t.bracketPairs.matchBracket(d.range.getStartPosition()))}let a=null,l=null;if(o){o.sort(W.compareRangesUsingStarts);const[d,h]=o;if(a=e?d.getStartPosition():d.getEndPosition(),l=e?h.getEndPosition():h.getStartPosition(),h.containsPosition(r)){const f=a;a=l,l=f}}a&&l&&i.push(new lt(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 r=t.bracketPairs.matchBracket(n);r||(r=t.bracketPairs.findEnclosingBrackets(n)),r&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:r[0],text:""},{range:r[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 r=[];let o=0;for(let f=0,p=e.length;f<p;f++){const m=e[f];m.isEmpty()&&(r[o++]=m.getStartPosition())}r.length>1&&r.sort(ie.compare);const a=[];let l=0,d=0;const h=n.length;for(let f=0,p=r.length;f<p;f++){const m=r[f];for(;d<h&&n[d].position.isBefore(m);)d++;if(d<h&&n[d].position.equals(m))a[l++]=n[d];else{let v=t.bracketPairs.matchBracket(m,20),b=Up._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!v&&this._matchBrackets==="always"&&(v=t.bracketPairs.findEnclosingBrackets(m,20),b=Up._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new Wit(m,v,b)}}this._lastBracketsData=a,this._lastVersionId=i}};Up.ID="editor.contrib.bracketMatchingController",Up._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=At.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:Kn(Oit),position:Gl.Center}}),Up._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=At.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let dy=Up;pi(dy.ID,dy,1);Pe(Fit);Pe(Ait);Pe(Bit);lr.appendMenuItem(rt.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:w({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class Vit{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,r=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&r===e.getLineMaxColumn(i)))if(this._isMovingLeft){const o=new W(i,n-1,i,n),a=e.getValueInRange(o);t.addEditOperation(o,null),t.addEditOperation(new W(i,r,i,r),a)}else{const o=new W(i,r,i,r+1),a=e.getValueInRange(o);t.addEditOperation(o,null),t.addEditOperation(new W(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new lt(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new lt(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class y0e extends Xe{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const r of n)i.push(new Vit(r,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class Hit extends y0e{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:w("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:U.writable})}}class $it extends y0e{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:w("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:U.writable})}}Pe(Hit);Pe($it);class zit extends Xe{constructor(){super({id:"editor.action.transposeLetters",label:w("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],r=t.getSelections();for(const o of r){if(!o.isEmpty())continue;const a=o.startLineNumber,l=o.startColumn,d=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&d===2))continue;const h=l===d?o.getPosition():Bi.rightPosition(i,o.getPosition().lineNumber,o.getPosition().column),f=Bi.leftPosition(i,h),p=Bi.leftPosition(i,f),m=i.getValueInRange(W.fromPositions(p,f)),v=i.getValueInRange(W.fromPositions(f,h)),b=W.fromPositions(p,h);n.push(new zr(b,v+m))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Pe(zit);const AH=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let s;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?s=crypto.getRandomValues.bind(crypto):s=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){s(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,r="";return r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+="-",r+=t[e[n++]],r+=t[e[n++]],r+="-",r+=t[e[n++]],r+=t[e[n++]],r+="-",r+=t[e[n++]],r+=t[e[n++]],r+="-",r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r}}();function one(s){return{asString:async()=>s,asFile:()=>{},value:typeof s=="string"?s:void 0}}function jit(s,e,t){const i={id:AH(),name:s,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class w0e{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 hi.some(this,([i,n])=>n.asFile())&&t.push("files"),x0e(d3(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))==null?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 d3(e)}}function d3(s){return s.toLowerCase()}function S0e(s,e){return x0e(d3(s),e.map(d3))}function x0e(s,e){if(s==="*/*")return e.length>0;if(e.includes(s))return!0;const t=s.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,r]=t;return r==="*"?e.some(o=>o.startsWith(n+"/")):!1}const FH=Object.freeze({create:s=>Mg(s.map(e=>e.toString())).join(`\r
|
|
887
|
+
*-----------------------------------------------------------------------------*/var hit=Object.defineProperty,fit=Object.getOwnPropertyDescriptor,git=Object.getOwnPropertyNames,pit=Object.prototype.hasOwnProperty,mit=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of git(e))!pit.call(s,n)&&n!==t&&hit(s,n,{get:()=>e[n],enumerable:!(i=fit(e,n))||i.enumerable});return s},_it=(s,e,t)=>(mit(s,e,"default"),t),vit="5.4.5",tx={};_it(tx,VN);var c0e=(s=>(s[s.None=0]="None",s[s.CommonJS=1]="CommonJS",s[s.AMD=2]="AMD",s[s.UMD=3]="UMD",s[s.System=4]="System",s[s.ES2015=5]="ES2015",s[s.ESNext=99]="ESNext",s))(c0e||{}),d0e=(s=>(s[s.None=0]="None",s[s.Preserve=1]="Preserve",s[s.React=2]="React",s[s.ReactNative=3]="ReactNative",s[s.ReactJSX=4]="ReactJSX",s[s.ReactJSXDev=5]="ReactJSXDev",s))(d0e||{}),u0e=(s=>(s[s.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",s[s.LineFeed=1]="LineFeed",s))(u0e||{}),h0e=(s=>(s[s.ES3=0]="ES3",s[s.ES5=1]="ES5",s[s.ES2015=2]="ES2015",s[s.ES2016=3]="ES2016",s[s.ES2017=4]="ES2017",s[s.ES2018=5]="ES2018",s[s.ES2019=6]="ES2019",s[s.ES2020=7]="ES2020",s[s.ESNext=99]="ESNext",s[s.JSON=100]="JSON",s[s.Latest=99]="Latest",s))(h0e||{}),f0e=(s=>(s[s.Classic=1]="Classic",s[s.NodeJs=2]="NodeJs",s))(f0e||{}),g0e=class{constructor(s,e,t,i,n){this._onDidChange=new tx.Emitter,this._onDidExtraLibsChange=new tx.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(s),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(s,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===s)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:s,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(s){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),s&&s.length>0)for(const e of s){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(s){this._compilerOptions=s||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(s){this._diagnosticsOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(s){this._workerOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(s){this._inlayHintsOptions=s||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(s){}setEagerModelSync(s){this._eagerModelSync=s}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(s){this._modeConfiguration=s||Object.create(null),this._onDidChange.fire(void 0)}},bit=vit,p0e={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},m0e=new g0e({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},p0e),_0e=new g0e({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},p0e),Cit=()=>PH().then(s=>s.getTypeScriptWorker()),yit=()=>PH().then(s=>s.getJavaScriptWorker());tx.languages.typescript={ModuleKind:c0e,JsxEmit:d0e,NewLineKind:u0e,ScriptTarget:h0e,ModuleResolutionKind:f0e,typescriptVersion:bit,typescriptDefaults:m0e,javascriptDefaults:_0e,getTypeScriptWorker:Cit,getJavaScriptWorker:yit};function PH(){return ot(()=>import("./tsMode-BZvUU1nf.js"),[])}tx.languages.onLanguage("typescript",()=>PH().then(s=>s.setupTypeScript(m0e)));tx.languages.onLanguage("javascript",()=>PH().then(s=>s.setupJavaScript(_0e)));class wit extends ta{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:Lt("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:Oe.map,toggled:ve.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ve.has("isInDiffEditor"),menu:{when:ve.has("isInDiffEditor"),id:rt.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Gt),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class v0e extends ta{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:Lt("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:ve.has("isInDiffEditor")})}run(e,...t){const i=e.get(Gt),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class b0e extends ta{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:Lt("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:ve.has("isInDiffEditor")})}run(e,...t){const i=e.get(Gt),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const $N=Lt("diffEditor","Diff Editor");class Sit extends Uu{constructor(){super({id:"diffEditor.switchSide",title:Lt("switchSide","Switch Side"),icon:Oe.arrowSwap,precondition:ve.has("isInDiffEditor"),f1:!0,category:$N})}runEditorCommand(e,t,i){const n=Gx(e);if(n instanceof Vg){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class xit extends Uu{constructor(){super({id:"diffEditor.exitCompareMove",title:Lt("exitCompareMove","Exit Compare Move"),icon:Oe.close,precondition:U.comparingMovedCode,f1:!1,category:$N,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Gx(e);n instanceof Vg&&n.exitCompareMove()}}class kit extends Uu{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Lt("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:Oe.fold,precondition:ve.has("isInDiffEditor"),f1:!0,category:$N})}runEditorCommand(e,t,...i){const n=Gx(e);n instanceof Vg&&n.collapseAllUnchangedRegions()}}class Lit extends Uu{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Lt("showAllUnchangedRegions","Show All Unchanged Regions"),icon:Oe.unfold,precondition:ve.has("isInDiffEditor"),f1:!0,category:$N})}runEditorCommand(e,t,...i){const n=Gx(e);n instanceof Vg&&n.showAllUnchangedRegions()}}class gZ extends ta{constructor(){super({id:"diffEditor.revert",title:Lt("revert","Revert"),f1:!1,category:$N})}run(e,t){const i=Dit(e,t.originalUri,t.modifiedUri);i instanceof Vg&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const C0e=Lt("accessibleDiffViewer","Accessible Diff Viewer"),iW=class iW extends ta{constructor(){super({id:iW.id,title:Lt("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:C0e,precondition:ve.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=Gx(e);t==null||t.accessibleDiffViewerNext()}};iW.id="editor.action.accessibleDiffViewer.next";let xT=iW;const nW=class nW extends ta{constructor(){super({id:nW.id,title:Lt("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:C0e,precondition:ve.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=Gx(e);t==null||t.accessibleDiffViewerPrev()}};nW.id="editor.action.accessibleDiffViewer.prev";let c3=nW;function Dit(s,e,t){return s.get(wi).listDiffEditors().find(r=>{var l,d;const o=r.getModifiedEditor(),a=r.getOriginalEditor();return o&&((l=o.getModel())==null?void 0:l.uri.toString())===t.toString()&&a&&((d=a.getModel())==null?void 0:d.uri.toString())===e.toString()})||null}function Gx(s){const t=s.get(wi).listDiffEditors(),i=jr();if(i)for(const n of t){const r=n.getContainerDomNode();if(Iit(r,i))return n}return null}function Iit(s,e){let t=e;for(;t;){if(t===s)return!0;t=t.parentElement}return!1}on(wit);on(v0e);on(b0e);lr.appendMenuItem(rt.EditorTitle,{command:{id:new b0e().desc.id,title:w("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:ve.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ve.has("isInDiffEditor")},order:11,group:"1_diff",when:ve.and(U.diffEditorRenderSideBySideInlineBreakpointReached,ve.has("isInDiffEditor"))});lr.appendMenuItem(rt.EditorTitle,{command:{id:new v0e().desc.id,title:w("showMoves","Show Moved Code Blocks"),icon:Oe.move,toggled:Tx.create("config.diffEditor.experimental.showMoves",!0),precondition:ve.has("isInDiffEditor")},order:10,group:"1_diff",when:ve.has("isInDiffEditor")});on(gZ);for(const s of[{icon:Oe.arrowRight,key:U.diffEditorInlineMode.toNegated()},{icon:Oe.discard,key:U.diffEditorInlineMode}])lr.appendMenuItem(rt.DiffEditorHunkToolbar,{command:{id:new gZ().desc.id,title:w("revertHunk","Revert Block"),icon:s.icon},when:ve.and(U.diffEditorModifiedWritable,s.key),order:5,group:"primary"}),lr.appendMenuItem(rt.DiffEditorSelectionToolbar,{command:{id:new gZ().desc.id,title:w("revertSelection","Revert Selection"),icon:s.icon},when:ve.and(U.diffEditorModifiedWritable,s.key),order:5,group:"primary"});on(Sit);on(xit);on(kit);on(Lit);lr.appendMenuItem(rt.EditorTitle,{command:{id:xT.id,title:w("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:ve.has("isInDiffEditor")},order:10,group:"2_diff",when:ve.and(U.accessibleDiffViewerVisible.negate(),ve.has("isInDiffEditor"))});fi.registerCommandAlias("editor.action.diffReview.next",xT.id);on(xT);fi.registerCommandAlias("editor.action.diffReview.prev",c3.id);on(c3);var Eit=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Tit=function(s,e){return function(t,i){e(t,i,s)}},pZ;const OH=new qe("selectionAnchorSet",!1);var tC;let __=(tC=class{static get(e){return e.getContribution(pZ.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=OH.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(lt.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new io().appendText(w("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Jo(w("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(lt.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()}},pZ=tC,tC.ID="editor.contrib.selectionAnchorController",tC);__=pZ=Eit([Tit(1,wt)],__);class Nit extends Xe{constructor(){super({id:"editor.action.setSelectionAnchor",label:w("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:Ds(2089,2080),weight:100}})}async run(e,t){var i;(i=__.get(t))==null||i.setSelectionAnchor()}}class Mit extends Xe{constructor(){super({id:"editor.action.goToSelectionAnchor",label:w("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:OH})}async run(e,t){var i;(i=__.get(t))==null||i.goToSelectionAnchor()}}class Rit extends Xe{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:w("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:OH,kbOpts:{kbExpr:U.editorTextFocus,primary:Ds(2089,2089),weight:100}})}async run(e,t){var i;(i=__.get(t))==null||i.selectFromAnchorToCursor()}}class Pit extends Xe{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:w("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:OH,kbOpts:{kbExpr:U.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=__.get(t))==null||i.cancelSelectionAnchor()}}pi(__.ID,__,4);Pe(Nit);Pe(Mit);Pe(Rit);Pe(Pit);const Oit=q("editorOverviewRuler.bracketMatchForeground","#A0A0A0",w("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class Ait extends Xe{constructor(){super({id:"editor.action.jumpToBracket",label:w("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=dy.get(t))==null||i.jumpToBracket()}}class Fit extends Xe{constructor(){super({id:"editor.action.selectToBracket",label:w("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:Lt("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 r;let n=!0;i&&i.selectBrackets===!1&&(n=!1),(r=dy.get(t))==null||r.selectToBracket(n)}}class Bit extends Xe{constructor(){super({id:"editor.action.removeBrackets",label:w("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=dy.get(t))==null||i.removeBrackets(this.id)}}class Wit{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const Up=class Up extends re{static get(e){return e.getContribution(Up.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Ui(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),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(72)&&(this._matchBrackets=this._editor.getOption(72),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(),r=e.bracketPairs.matchBracket(n);let o=null;if(r)r[0].containsPosition(n)&&!r[1].containsPosition(n)?o=r[1].getStartPosition():r[1].containsPosition(n)&&(o=r[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)o=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(n);l&&l.range&&(o=l.range.getStartPosition())}}return o?new lt(o.lineNumber,o.column,o.lineNumber,o.column):new lt(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 r=n.getStartPosition();let o=t.bracketPairs.matchBracket(r);if(!o&&(o=t.bracketPairs.findEnclosingBrackets(r),!o)){const d=t.bracketPairs.findNextBracket(r);d&&d.range&&(o=t.bracketPairs.matchBracket(d.range.getStartPosition()))}let a=null,l=null;if(o){o.sort(W.compareRangesUsingStarts);const[d,h]=o;if(a=e?d.getStartPosition():d.getEndPosition(),l=e?h.getEndPosition():h.getStartPosition(),h.containsPosition(r)){const f=a;a=l,l=f}}a&&l&&i.push(new lt(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 r=t.bracketPairs.matchBracket(n);r||(r=t.bracketPairs.findEnclosingBrackets(n)),r&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:r[0],text:""},{range:r[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 r=[];let o=0;for(let f=0,p=e.length;f<p;f++){const m=e[f];m.isEmpty()&&(r[o++]=m.getStartPosition())}r.length>1&&r.sort(ie.compare);const a=[];let l=0,d=0;const h=n.length;for(let f=0,p=r.length;f<p;f++){const m=r[f];for(;d<h&&n[d].position.isBefore(m);)d++;if(d<h&&n[d].position.equals(m))a[l++]=n[d];else{let v=t.bracketPairs.matchBracket(m,20),b=Up._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!v&&this._matchBrackets==="always"&&(v=t.bracketPairs.findEnclosingBrackets(m,20),b=Up._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new Wit(m,v,b)}}this._lastBracketsData=a,this._lastVersionId=i}};Up.ID="editor.contrib.bracketMatchingController",Up._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=At.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:Kn(Oit),position:Gl.Center}}),Up._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=At.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let dy=Up;pi(dy.ID,dy,1);Pe(Fit);Pe(Ait);Pe(Bit);lr.appendMenuItem(rt.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:w({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class Vit{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,r=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&r===e.getLineMaxColumn(i)))if(this._isMovingLeft){const o=new W(i,n-1,i,n),a=e.getValueInRange(o);t.addEditOperation(o,null),t.addEditOperation(new W(i,r,i,r),a)}else{const o=new W(i,r,i,r+1),a=e.getValueInRange(o);t.addEditOperation(o,null),t.addEditOperation(new W(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new lt(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new lt(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class y0e extends Xe{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const r of n)i.push(new Vit(r,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class Hit extends y0e{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:w("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:U.writable})}}class $it extends y0e{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:w("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:U.writable})}}Pe(Hit);Pe($it);class zit extends Xe{constructor(){super({id:"editor.action.transposeLetters",label:w("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],r=t.getSelections();for(const o of r){if(!o.isEmpty())continue;const a=o.startLineNumber,l=o.startColumn,d=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&d===2))continue;const h=l===d?o.getPosition():Bi.rightPosition(i,o.getPosition().lineNumber,o.getPosition().column),f=Bi.leftPosition(i,h),p=Bi.leftPosition(i,f),m=i.getValueInRange(W.fromPositions(p,f)),v=i.getValueInRange(W.fromPositions(f,h)),b=W.fromPositions(p,h);n.push(new zr(b,v+m))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Pe(zit);const AH=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let s;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?s=crypto.getRandomValues.bind(crypto):s=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){s(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,r="";return r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+="-",r+=t[e[n++]],r+=t[e[n++]],r+="-",r+=t[e[n++]],r+=t[e[n++]],r+="-",r+=t[e[n++]],r+=t[e[n++]],r+="-",r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r}}();function one(s){return{asString:async()=>s,asFile:()=>{},value:typeof s=="string"?s:void 0}}function jit(s,e,t){const i={id:AH(),name:s,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class w0e{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 hi.some(this,([i,n])=>n.asFile())&&t.push("files"),x0e(d3(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))==null?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 d3(e)}}function d3(s){return s.toLowerCase()}function S0e(s,e){return x0e(d3(s),e.map(d3))}function x0e(s,e){if(s==="*/*")return e.length>0;if(e.includes(s))return!0;const t=s.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,r]=t;return r==="*"?e.some(o=>o.startsWith(n+"/")):!1}const FH=Object.freeze({create:s=>Mg(s.map(e=>e.toString())).join(`\r
|
|
888
888
|
`),split:s=>s.split(`\r
|
|
889
889
|
`),parse:s=>FH.split(s).filter(e=>!e.startsWith("#"))}),xh=class xh{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+xh.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new xh((this.value?[this.value,...e]:e).join(xh.sep))}};xh.sep=".",xh.None=new xh("@@none@@"),xh.Empty=new xh("");let Nn=xh;const Ufe={EDITORS:"CodeEditors",FILES:"CodeFiles"};class Uit{}const qit={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Wn.add(qit.DragAndDropContribution,new Uit);const sE=class sE{constructor(){}static getInstance(){return sE.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};sE.INSTANCE=new sE;let mZ=sE;function k0e(s){const e=new w0e;for(const t of s.items){const i=t.type;if(t.kind==="string"){const n=new Promise(r=>t.getAsString(r));e.append(i,one(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,Kit(n))}}return e}function Kit(s){const e=s.path?pt.parse(s.path):void 0;return jit(s.name,e,async()=>new Uint8Array(await s.arrayBuffer()))}const Git=Object.freeze([Ufe.EDITORS,Ufe.FILES,ZE.RESOURCES,ZE.INTERNAL_URI_LIST]);function L0e(s,e=!1){const t=k0e(s),i=t.get(ZE.INTERNAL_URI_LIST);if(i)t.replace(ts.uriList,i);else if(e||!t.has(ts.uriList)){const n=[];for(const r of s.items){const o=r.getAsFile();if(o){const a=o.path;try{a?n.push(pt.file(a).toString()):n.push(pt.parse(o.name,!0).toString())}catch{}}}n.length&&t.replace(ts.uriList,one(FH.create(n)))}for(const n of Git)t.delete(n);return t}var ane=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},kT=function(s,e){return function(t,i){e(t,i,s)}};class lne{async provideDocumentPasteEdits(e,t,i,n,r){const o=await this.getEdit(i,r);if(o)return{edits:[{insertText:o.insertText,title:o.title,kind:o.kind,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,n){const r=await this.getEdit(i,n);if(r)return{edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}],dispose(){}}}}const rE=class rE extends lne{constructor(){super(...arguments),this.kind=rE.kind,this.dropMimeTypes=[ts.text],this.pasteMimeTypes=[ts.text]}async getEdit(e,t){const i=e.get(ts.text);if(!i||e.has(ts.uriList))return;const n=await i.asString();return{handledMimeType:ts.text,title:w("text.label","Insert Plain Text"),insertText:n,kind:this.kind}}};rE.id="text",rE.kind=new Nn("text.plain");let uy=rE;class D0e extends lne{constructor(){super(...arguments),this.kind=new Nn("uri.absolute"),this.dropMimeTypes=[ts.uriList],this.pasteMimeTypes=[ts.uriList]}async getEdit(e,t){const i=await I0e(e);if(!i.length||t.isCancellationRequested)return;let n=0;const r=i.map(({uri:a,originalText:l})=>a.scheme===Rt.file?a.fsPath:(n++,l)).join(" ");let o;return n>0?o=i.length>1?w("defaultDropProvider.uriList.uris","Insert Uris"):w("defaultDropProvider.uriList.uri","Insert Uri"):o=i.length>1?w("defaultDropProvider.uriList.paths","Insert Paths"):w("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:ts.uriList,insertText:r,title:o,kind:this.kind}}}let u3=class extends lne{constructor(e){super(),this._workspaceContextService=e,this.kind=new Nn("uri.relative"),this.dropMimeTypes=[ts.uriList],this.pasteMimeTypes=[ts.uriList]}async getEdit(e,t){const i=await I0e(e);if(!i.length||t.isCancellationRequested)return;const n=Id(i.map(({uri:r})=>{const o=this._workspaceContextService.getWorkspaceFolder(r);return o?J8e(o.uri,r):void 0}));if(n.length)return{handledMimeType:ts.uriList,insertText:n.join(" "),title:i.length>1?w("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):w("defaultDropProvider.uriList.relativePath","Insert Relative Path"),kind:this.kind}}};u3=ane([kT(0,sy)],u3);class Yit{constructor(){this.kind=new Nn("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:ts.text}]}async provideDocumentPasteEdits(e,t,i,n,r){var l;if(n.triggerKind!==xE.PasteAs&&!((l=n.only)!=null&&l.contains(this.kind)))return;const o=i.get("text/html"),a=await(o==null?void 0:o.asString());if(!(!a||r.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:w("pasteHtmlLabel","Insert HTML"),kind:this.kind}]}}}async function I0e(s){const e=s.get(ts.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of FH.parse(t))try{i.push({uri:pt.parse(n),originalText:n})}catch{}return i}let _Z=class extends re{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new uy)),this._register(e.documentDropEditProvider.register("*",new D0e)),this._register(e.documentDropEditProvider.register("*",new u3(t)))}};_Z=ane([kT(0,nt),kT(1,sy)],_Z);let vZ=class extends re{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new uy)),this._register(e.documentPasteEditProvider.register("*",new D0e)),this._register(e.documentPasteEditProvider.register("*",new u3(t))),this._register(e.documentPasteEditProvider.register("*",new Yit))}};vZ=ane([kT(0,nt),kT(1,sy)],vZ);const hd=class hd{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),n;if(n=hd._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(hd.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(hd.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(hd.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(hd.isVariableCharacter(i)||hd.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof hd._table[i]>"u"&&!hd.isDigitCharacter(i)&&!hd.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};hd._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let bZ=hd;class Yx{constructor(){this._children=[]}appendChild(e){return e instanceof Ho&&this._children[this._children.length-1]instanceof Ho?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),r=i.children.slice(0);r.splice(n,1,...t),i._children=r,function o(a,l){for(const d of a)d.parent=l,o(d.children,d)}(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof zN)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class Ho extends Yx{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new Ho(this.value)}}class E0e extends Yx{}class xc extends E0e{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof Zx?this._children[0]:void 0}clone(){const e=new xc(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class Zx extends Yx{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Ho&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new Zx;return this.options.forEach(e.appendChild,e),e}}class cne extends Yx{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(r=>r instanceof du&&!!r.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof du){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new cne;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class du extends Yx{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,n)=>n===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new du(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class LT extends E0e{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new Ho(t)],!0):!1}clone(){const e=new LT(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function qfe(s,e){const t=[...s];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class zN extends Yx{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof xc&&(e.push(i),t=!t||t.index<i.index?i:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,i=!1;return this.walk(n=>n===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return qfe([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof xc&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof LT&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){const e=new zN;return this._children=this.children.map(t=>t.clone()),e}walk(e){qfe(this.children,e)}}class hy{constructor(){this._scanner=new bZ,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new zN;return this.parseFragment(e,n),this.ensureFinalTabstop(n,i??!1,t??!1),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,r=[];t.walk(l=>(l instanceof xc&&(l.isFinalTabstop?n.set(0,void 0):!n.has(l.index)&&l.children.length>0?n.set(l.index,l.children):r.push(l)),!0));const o=(l,d)=>{const h=n.get(l.index);if(!h)return;const f=new xc(l.index);f.transform=l.transform;for(const p of h){const m=p.clone();f.appendChild(m),m instanceof xc&&n.has(m.index)&&!d.has(m.index)&&(d.add(m.index),o(m,d),d.delete(m.index))}t.replace(l,[f])},a=new Set;for(const l of r)o(l,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(r=>r.index===0)||e.appendChild(new xc(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const n=this._scanner.next();if(n.type!==0&&n.type!==4&&n.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new Ho(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new xc(Number(t)):new LT(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const r=new xc(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new Ho("${"+t+":")),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(7)){const o=new Zx;for(;;){if(this._parseChoiceElement(o)){if(this._accept(2))continue;if(this._accept(7)&&(r.appendChild(o),this._accept(4)))return e.appendChild(r),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(r),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let n;if((n=this._accept(5,!0))?n=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new Ho(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const r=new LT(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new Ho("${"+t+":")),r.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(r),!0):this._backTo(i)}_parseTransform(e){const t=new cne;let i="",n="";for(;!this._accept(6);){let r;if(r=this._accept(5,!0)){r=this._accept(6,!0)||r,i+=r;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let r;if(r=this._accept(5,!0)){r=this._accept(5,!0)||this._accept(6,!0)||r,t.appendChild(new Ho(r));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const n=this._accept(8,!0);if(n)if(i){if(this._accept(4))return e.appendChild(new du(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new du(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(6)){const r=this._accept(9,!0);return!r||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new du(Number(n),r)),!0)}else if(this._accept(11)){const r=this._until(4);if(r)return e.appendChild(new du(Number(n),void 0,r,void 0)),!0}else if(this._accept(12)){const r=this._until(4);if(r)return e.appendChild(new du(Number(n),void 0,void 0,r)),!0}else if(this._accept(13)){const r=this._until(1);if(r){const o=this._until(4);if(o)return e.appendChild(new du(Number(n),void 0,r,o)),!0}}else{const r=this._until(4);if(r)return e.appendChild(new du(Number(n),void 0,void 0,r)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new Ho(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function T0e(s,e,t){var i,n;return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:((i=t.additionalEdit)==null?void 0:i.edits)??[]}:{edits:[...e.map(r=>new Em(s,{range:r,text:typeof t.insertText=="string"?hy.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...((n=t.additionalEdit)==null?void 0:n.edits)??[]]}}function N0e(s){function e(o,a){return"mimeType"in o?o.mimeType===a.handledMimeType:!!a.kind&&o.kind.contains(a.kind)}const t=new Map;for(const o of s)for(const a of o.yieldTo??[])for(const l of s)if(l!==o&&e(a,l)){let d=t.get(o);d||(d=[],t.set(o,d)),d.push(l)}if(!t.size)return Array.from(s);const i=new Set,n=[];function r(o){if(!o.length)return[];const a=o[0];if(n.includes(a))return console.warn("Yield to cycle detected",a),o;if(i.has(a))return r(o.slice(1));let l=[];const d=t.get(a);return d&&(n.push(a),l=r(d),n.pop()),i.add(a),[...l,a,...r(o.slice(1))]}return r(Array.from(s))}var Zit=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Xit=function(s,e){return function(t,i){e(t,i,s)}};const Qit=At.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:sbe,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),sW=class sW extends re{constructor(e,t,i,n,r){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=r,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=Fe(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=Fe("span.icon");this.domNode.append(t),t.classList.add(...Ct.asClassNameArray(Oe.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(67);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(67))&&i()})),this._register(ue(this.domNode,Ae.CLICK,n=>{this.delegate.cancel()}))}getId(){return sW.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)}};sW.baseId="editor.widget.inlineProgressWidget";let CZ=sW,h3=class extends re{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new er),this._currentWidget=this._register(new er),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,r){const o=this._operationIdPool++;this._currentOperation=o,this.clear(),this._showPromise.value=o_(()=>{const a=W.fromPositions(e);this._currentDecorations.set([{range:a,options:Qit}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(CZ,this.id,this._editor,a,t,n))},r??this._showDelay);try{return await i}finally{this._currentOperation===o&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};h3=Zit([Xit(2,ht)],h3);var Jit=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Kfe=function(s,e){return function(t,i){e(t,i,s)}},SF,Pm;let al=(Pm=class{static get(e){return e.getContribution(SF.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new er,this._messageListeners=new me,this._mouseOverMessage=!1,this._editor=e,this._visible=SF.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)==null||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){Jo(Mu(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Mu(e)?nH(e,{actionHandler:{callback:n=>{this.closeMessage(),Ite(this._openerService,n,Mu(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new Gfe(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(We.debounce(this._editor.onDidBlurEditorText,(n,r)=>r,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Zs(jr(),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(ue(this._messageWidget.value.getDomNode(),Ae.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ue(this._messageWidget.value.getDomNode(),Ae.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 W(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Gfe.fadeOut(this._messageWidget.value))}},SF=Pm,Pm.ID="editor.contrib.messageController",Pm.MESSAGE_VISIBLE=new qe("messageVisible",!1,w("messageVisible","Whether the editor is currently showing an inline message")),Pm);al=SF=Jit([Kfe(1,wt),Kfe(2,Ta)],al);const ent=zs.bindToContribution(al.get);Ue(new ent({id:"leaveEditorMessage",precondition:al.MESSAGE_VISIBLE,handler:s=>s.closeMessage(),kbOpts:{weight:130,primary:9}}));let Gfe=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 r=document.createElement("div");r.classList.add("anchor","top"),this._domNode.appendChild(r);const o=document.createElement("div");typeof n=="string"?(o.classList.add("message"),o.textContent=n):(n.classList.add("message"),o.appendChild(n)),this._domNode.appendChild(o);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)}};pi(al.ID,al,4);function dj(s,e){return e&&(s.stack||s.stacktrace)?w("stackTrace.format","{0}: {1}",Zfe(s),Yfe(s.stack)||Yfe(s.stacktrace)):Zfe(s)}function Yfe(s){return Array.isArray(s)?s.join(`
|
|
890
890
|
`):s}function Zfe(s){return s.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${s.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof s.code=="string"&&typeof s.errno=="number"&&typeof s.syscall=="string"?w("nodeExceptionMessage","A system error occurred ({0})",s.message):s.message||w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function f3(s=null,e=!1){if(!s)return w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(s)){const t=Id(s),i=f3(t[0],e);return t.length>1?w("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(ya(s))return s;if(s.detail){const t=s.detail;if(t.error)return dj(t.error,e);if(t.exception)return dj(t.exception,e)}return s.stack?dj(s,e):s.message?s.message:w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var M0e=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},uS=function(s,e){return function(t,i){e(t,i,s)}},yZ,iC;let wZ=(iC=class extends re{constructor(e,t,i,n,r,o,a,l,d,h){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=r,this.edits=o,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=h,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(d),this.visibleContext.set(!0),this._register(ut(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(ut(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(f=>{r.containsPosition(f.position)||this.dispose()})),this._register(We.runAndSubscribe(h.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var t;const e=(t=this._keybindingService.lookupKeybinding(this.showCommand.id))==null?void 0:t.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=Fe(".post-edit-widget"),this.button=this._register(new _5(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ue(this.domNode,Ae.CLICK,()=>this.showSelector()))}getId(){return yZ.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=is(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>Pb({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},yZ=iC,iC.baseId="editor.widget.postEditWidget",iC);wZ=yZ=M0e([uS(7,gl),uS(8,wt),uS(9,Ri)],wZ);let g3=class extends re{constructor(e,t,i,n,r,o,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=r,this._bulkEditService=o,this._notificationService=a,this._currentWidget=this._register(new er),this._register(We.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,r){const o=this._editor.getModel();if(!o||!e.length)return;const a=t.allEdits.at(t.activeEditIndex);if(!a)return;const l=async y=>{const x=this._editor.getModel();x&&(await x.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:y,allEdits:t.allEdits},i,n,r))},d=(y,x)=>{zc(y)||(this._notificationService.error(x),i&&this.show(e[0],t,l))};let h;try{h=await n(a,r)}catch(y){return d(y,w("resolveError",`Error resolving edit '{0}':
|
|
@@ -949,4 +949,4 @@ ${e.toString()}`}}class M5{constructor(e=new jx,t=!1,i,n=kGe){this._services=e,t
|
|
|
949
949
|
`));const b=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:"advanced"});return lH.fromFn(async()=>{const y=await b.computeDiff(this._originalModel.get(),this._modifiedModel.get(),{computeMoves:!1,ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3},zt.None);if(!y.identical)return new Gdt(Wt.fromRangeInclusive(h),p(f),y.changes)})}),this._fetchStore=this._register(new me),this._inlineEditsFetchResult=YE(this,void 0),this._inlineEdits=Vl({owner:this,equalsFn:t5},l=>{var d;return((d=this._inlineEditsFetchResult.read(l))==null?void 0:d.completions.map(h=>new Jdt(h)))??[]}),this._fetchInlineEditsPromise=wye({owner:this,createEmptyChangeSummary:()=>({inlineCompletionTriggerKind:Du.Automatic}),handleChange:(l,d)=>(l.didChange(this._forceUpdateExplicitlySignal)&&(d.inlineCompletionTriggerKind=Du.Explicit),!0)},async(l,d)=>{this._fetchStore.clear(),this._forceUpdateExplicitlySignal.read(l),this._textModelVersionId.read(l);function h(b,y){return y(b)}const f=this._pinnedRange.range.read(l)??h(this._selection.read(l),b=>b.isEmpty()?void 0:b);if(!f){this._inlineEditsFetchResult.set(void 0,void 0),this.userPrompt.set(void 0,void 0);return}const p={triggerKind:d.inlineCompletionTriggerKind,selectedSuggestionInfo:void 0,userPrompt:this.userPrompt.read(l)},m=AU(this._fetchStore);await Og(200,m);const v=await QSe(this.languageFeaturesService.inlineCompletionsProvider,f,this.textModel,p,m);m.isCancellationRequested||this._inlineEditsFetchResult.set(v,void 0)}),this._filteredInlineEditItems=Vl({owner:this,equalsFn:e5()},l=>this._inlineEdits.read(l)),this.selectedInlineCompletionIndex=ct(this,l=>{const d=this._selectedInlineCompletionId.read(l),h=this._filteredInlineEditItems.read(l),f=this._selectedInlineCompletionId===void 0?-1:h.findIndex(p=>p.semanticId===d);return f===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):f}),this.selectedInlineEdit=ct(this,l=>{const d=this._filteredInlineEditItems.read(l),h=this.selectedInlineCompletionIndex.read(l);return d[h]}),this._register(Vx(this._fetchInlineEditsPromise))}async triggerExplicitly(e){ry(e,t=>{this._isActive.set(!0,t),this._forceUpdateExplicitlySignal.trigger(t)}),await this._fetchInlineEditsPromise.get()}stop(e){ry(e,t=>{this.userPrompt.set(void 0,t),this._isActive.set(!1,t),this._inlineEditsFetchResult.set(void 0,t),this._pinnedRange.setRange(void 0,t)})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineEditItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}async accept(e){if(e.getModel()!==this.textModel)throw new Li;const t=this.selectedInlineEdit.get();t&&(e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[t.inlineCompletion.toSingleTextEdit().toSingleEditOperation()]),this.stop())}},QD=NC,NC._modelId=0,NC);cQ=QD=Qdt([Pj(4,nt),Pj(5,WN),Pj(6,_n)],cQ);class Jdt{constructor(e){this.inlineCompletion=e,this.semanticId=this.inlineCompletion.hash()}}class eut extends re{constructor(e,t){super(),this._textModel=e,this._versionId=t,this._decorations=Kt(this,[]),this.range=ct(this,i=>{this._versionId.read(i);const n=this._decorations.read(i)[0];return n?this._textModel.getDecorationRange(n)??null:null}),this._register(ut(()=>{this._textModel.deltaDecorations(this._decorations.get(),[])}))}setRange(e,t){this._decorations.set(this._textModel.deltaDecorations(this._decorations.get(),e?[{range:e,options:{description:"trackedRange"}}]:[]),t)}}var tut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},xD=function(s,e){return function(t,i){e(t,i,s)}},dQ,MC;let zg=(MC=class extends re{static get(e){return e.getContribution(dQ.ID)}constructor(e,t,i,n,r,o){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._debounceService=n,this._languageFeaturesService=r,this._configurationService=o,this._enabled=yJe("editor.inlineEdits.enabled",!1,this._configurationService),this._editorObs=el(this.editor),this._selection=ct(this,a=>this._editorObs.cursorSelection.read(a)??new lt(1,1,1,1)),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineEditsDebounce",{min:50,max:50}),this.model=bo(this,a=>{if(!this._enabled.read(a)||this._editorObs.isReadonly.read(a))return;const l=this._editorObs.model.read(a);return l?this._instantiationService.createInstance(Za(cQ,a),l,this._editorObs.versionId,this._selection,this._debounceValue):void 0}),this._hadInlineEdit=TN(this,(a,l)=>{var d;return l||((d=this.model.read(a))==null?void 0:d.inlineEdit.read(a))!==void 0}),this._widget=bo(this,a=>{if(this._hadInlineEdit.read(a))return this._instantiationService.createInstance(Za(lQ,a),this.editor,this.model.map((l,d)=>l==null?void 0:l.inlineEdit.read(d)),iut(l=>{var d;return((d=this.model.read(l))==null?void 0:d.userPrompt)??Kt("empty","")}))}),this._register(su(gx,this._contextKeyService,a=>{var l;return!!((l=this.model.read(a))!=null&&l.inlineEdit.read(a))})),this._register(su(jdt,this._contextKeyService,a=>{var l;return!!((l=this.model.read(a))!=null&&l.isPinned.read(a))})),this.model.recomputeInitiallyAndOnChange(this._store),this._widget.recomputeInitiallyAndOnChange(this._store)}},dQ=MC,MC.ID="editor.contrib.inlineEditsController",MC);zg=dQ=tut([xD(1,ht),xD(2,wt),xD(3,sc),xD(4,nt),xD(5,Gt)],zg);function iut(s){return DN(void 0,e=>s(e).read(e),(e,t)=>{s(void 0).set(e,t)})}function XN(s){return{label:s.value,alias:s.original}}const EW=class EW extends Xe{constructor(){super({id:EW.ID,...XN(Lt("action.inlineEdits.showNext","Show Next Inline Edit")),precondition:ve.and(U.writable,gx),kbOpts:{weight:100,primary:606}})}async run(e,t){var n;const i=zg.get(t);(n=i==null?void 0:i.model.get())==null||n.next()}};EW.ID=zdt;let uQ=EW;const TW=class TW extends Xe{constructor(){super({id:TW.ID,...XN(Lt("action.inlineEdits.showPrevious","Show Previous Inline Edit")),precondition:ve.and(U.writable,gx),kbOpts:{weight:100,primary:604}})}async run(e,t){var n;const i=zg.get(t);(n=i==null?void 0:i.model.get())==null||n.previous()}};TW.ID=$dt;let hQ=TW;class nut extends Xe{constructor(){super({id:"editor.action.inlineEdits.trigger",...XN(Lt("action.inlineEdits.trigger","Trigger Inline Edit")),precondition:U.writable})}async run(e,t){const i=zg.get(t);await yye(async n=>{var r;await((r=i==null?void 0:i.model.get())==null?void 0:r.triggerExplicitly(n))})}}class sut extends Xe{constructor(){super({id:Hdt,...XN(Lt("action.inlineEdits.accept","Accept Inline Edit")),precondition:gx,menuOpts:{menuId:rt.InlineEditsActions,title:w("inlineEditsActions","Accept Inline Edit"),group:"primary",order:1,icon:Oe.check},kbOpts:{primary:2058,weight:2e4,kbExpr:gx}})}async run(e,t){var n;t instanceof Od&&(t=t.getParentEditor());const i=zg.get(t);i&&((n=i.model.get())==null||n.accept(i.editor),i.editor.focus())}}const NW=class NW extends Xe{constructor(){super({id:NW.ID,...XN(Lt("action.inlineEdits.hide","Hide Inline Edit")),precondition:gx,kbOpts:{weight:100,primary:9}})}async run(e,t){const i=zg.get(t);Fn(n=>{var r;(r=i==null?void 0:i.model.get())==null||r.stop(n)})}};NW.ID="editor.action.inlineEdits.hide";let fQ=NW;pi(zg.ID,zg,3);Pe(nut);Pe(uQ);Pe(hQ);Pe(sut);Pe(fQ);const Cy={Visible:new qe("parameterHintsVisible",!1),MultipleSignatures:new qe("parameterHintsMultipleSignatures",!1)};async function _xe(s,e,t,i,n){const r=s.ordered(e);for(const o of r)try{const a=await o.provideSignatureHelp(e,t,n,i);if(a)return a}catch(a){ns(a)}}fi.registerCommand("_executeSignatureHelpProvider",async(s,...e)=>{const[t,i,n]=e;yi(pt.isUri(t)),yi(ie.isIPosition(i)),yi(typeof n=="string"||!n);const r=s.get(nt),o=await s.get(Ia).createModelReference(t);try{const a=await _xe(r.signatureHelpProvider,o.object.textEditorModel,ie.lift(i),{triggerKind:Uh.Invoke,isRetrigger:!1,triggerCharacter:n},zt.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{o.dispose()}});var Hp;(function(s){s.Default={type:0};class e{constructor(n,r){this.request=n,this.previouslyActiveHints=r,this.type=2}}s.Pending=e;class t{constructor(n){this.hints=n,this.type=1}}s.Active=t})(Hp||(Hp={}));const MW=class MW extends re{constructor(e,t,i=MW.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new se),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=Hp.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new er),this.triggerChars=new M4,this.retriggerChars=new M4,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Ac(i),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(n=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(n=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(n=>this.onCursorChange(n))),this._register(this.editor.onDidChangeModelContent(n=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(n=>this.onDidType(n))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=Hp.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!this.providers.has(i))return;const n=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(n),t).catch(Nt)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,n=this.editor.getOption(86).cycle;if((e<2||i)&&!n){this.cancel();return}this.updateActiveSignature(i&&n?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t===0,n=this.editor.getOption(86).cycle;if((e<2||i)&&!n){this.cancel();return}this.updateActiveSignature(i&&n?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new Hp.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){const t=this.state.type===1||this.state.type===2,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const n=this._pendingTriggers.reduce(rut);this._pendingTriggers=[];const r={triggerKind:n.triggerKind,triggerCharacter:n.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const o=this.editor.getModel(),a=this.editor.getPosition();this.state=new Hp.Pending(Xs(l=>_xe(this.providers,o,a,r,l)),i);try{const l=await this.state.request;return e!==this.triggerId?(l==null||l.dispose(),!1):!l||!l.value.signatures||l.value.signatures.length===0?(l==null||l.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new Hp.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=Hp.Default),Nt(l),!1}}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const i of t.signatureHelpTriggerCharacters||[])if(i.length){const n=i.charCodeAt(0);this.triggerChars.add(n),this.retriggerChars.add(n)}for(const i of t.signatureHelpRetriggerCharacters||[])i.length&&this.retriggerChars.add(i.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:Uh.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:Uh.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:Uh.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(86).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}};MW.DEFAULT_DELAY=120;let gQ=MW;function rut(s,e){switch(e.triggerKind){case Uh.Invoke:return e;case Uh.ContentChange:return s;case Uh.TriggerCharacter:default:return e}}var out=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},M2=function(s,e){return function(t,i){e(t,i,s)}},pQ;const Il=Fe,aut=vn("parameter-hints-next",Oe.chevronDown,w("parameterHintsNextIcon","Icon for show next parameter hint.")),lut=vn("parameter-hints-previous",Oe.chevronUp,w("parameterHintsPreviousIcon","Icon for show previous parameter hint."));var RC;let mQ=(RC=class extends re{constructor(e,t,i,n,r,o){super(),this.editor=e,this.model=t,this.telemetryService=o,this.renderDisposeables=this._register(new me),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new Bg({editor:e},r,n)),this.keyVisible=Cy.Visible.bindTo(i),this.keyMultipleSignatures=Cy.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=Il(".editor-widget.parameter-hints-widget"),t=Ie(e,Il(".phwrapper"));t.tabIndex=-1;const i=Ie(t,Il(".controls")),n=Ie(i,Il(".button"+Ct.asCSSSelector(lut))),r=Ie(i,Il(".overloads")),o=Ie(i,Il(".button"+Ct.asCSSSelector(aut)));this._register(ue(n,"click",p=>{li.stop(p),this.previous()})),this._register(ue(o,"click",p=>{li.stop(p),this.next()}));const a=Il(".body"),l=new wN(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const d=Ie(a,Il(".signature")),h=Ie(a,Il(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:d,overloads:r,docs:h,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(p=>{this.visible&&this.editor.layoutContentWidget(this)}));const f=()=>{if(!this.domNodes)return;const p=this.editor.getOption(50),m=this.domNodes.element;m.style.fontSize=`${p.fontSize}px`,m.style.lineHeight=`${p.lineHeight/p.fontSize}`,m.style.setProperty("--vscode-parameterHintsWidget-editorFontFamily",p.fontFamily),m.style.setProperty("--vscode-parameterHintsWidget-editorFontFamilyDefault",Go.fontFamily)};f(),this._register(We.chain(this.editor.onDidChangeConfiguration.bind(this.editor),p=>p.filter(m=>m.hasChanged(50)))(f)),this._register(this.editor.onDidLayoutChange(p=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{var e;(e=this.domNodes)==null||e.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,(e=this.domNodes)==null||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){if(this.renderDisposeables.clear(),!this.domNodes)return;const t=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",t),this.keyMultipleSignatures.set(t),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const i=e.signatures[e.activeSignature];if(!i)return;const n=Ie(this.domNodes.signature,Il(".code")),r=i.parameters.length>0,o=i.activeParameter??e.activeParameter;if(r)this.renderParameters(n,i,o);else{const d=Ie(n,Il("span"));d.textContent=i.label}const a=i.parameters[o];if(a!=null&&a.documentation){const d=Il("span.documentation");if(typeof a.documentation=="string")d.textContent=a.documentation;else{const h=this.renderMarkdownDocs(a.documentation);d.appendChild(h.element)}Ie(this.domNodes.docs,Il("p",{},d))}if(i.documentation!==void 0)if(typeof i.documentation=="string")Ie(this.domNodes.docs,Il("p",{},i.documentation));else{const d=this.renderMarkdownDocs(i.documentation);Ie(this.domNodes.docs,d.element)}const l=this.hasDocs(i,a);if(this.domNodes.signature.classList.toggle("has-docs",l),this.domNodes.docs.classList.toggle("empty",!l),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,a){let d="";const h=i.parameters[o];Array.isArray(h.label)?d=i.label.substring(h.label[0],h.label[1]):d=h.label,h.documentation&&(d+=typeof h.documentation=="string"?`, ${h.documentation}`:`, ${h.documentation.value}`),i.documentation&&(d+=typeof i.documentation=="string"?`, ${i.documentation}`:`, ${i.documentation.value}`),this.announcedLabel!==d&&(Jo(w("hint","{0}, hint",d)),this.announcedLabel=d)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=new ur,i=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var r;(r=this.domNodes)==null||r.scrollbar.scanDomNode()}}));i.element.classList.add("markdown-docs");const n=t.elapsed();return n>300&&this.telemetryService.publicLog2("parameterHints.parseMarkdown",{renderDuration:n}),i}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&om(t.documentation).length>0||t&&typeof t.documentation=="object"&&om(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&om(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&om(e.documentation.value).length>0)}renderParameters(e,t,i){const[n,r]=this.getParameterLabelOffsets(t,i),o=document.createElement("span");o.textContent=t.label.substring(0,n);const a=document.createElement("span");a.textContent=t.label.substring(n,r),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(r),Ie(e,o,a,l)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const n=new RegExp(`(\\W|^)${Xl(i.label)}(?=\\W|$)`,"g");n.test(e.label);const r=n.lastIndex-i.label.length;return r>=0?[r,n.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return pQ.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const i=this.domNodes.element.getElementsByClassName("phwrapper");i.length&&(i[0].style.maxHeight=t)}},pQ=RC,RC.ID="editor.widget.parameterHintsWidget",RC);mQ=pQ=out([M2(2,wt),M2(3,Ta),M2(4,Rn),M2(5,oo)],mQ);q("editorHoverWidget.highlightForeground",o0,w("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var cut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},fpe=function(s,e){return function(t,i){e(t,i,s)}},_Q,PC;let px=(PC=class extends re{static get(e){return e.getContribution(_Q.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new gQ(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(n=>{var r;n?(this.widget.value.show(),this.widget.value.render(n)):(r=this.widget.rawValue)==null||r.hide()})),this.widget=new Pu(()=>this._register(t.createInstance(mQ,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var e;(e=this.widget.rawValue)==null||e.previous()}next(){var e;(e=this.widget.rawValue)==null||e.next()}trigger(e){this.model.trigger(e,0)}},_Q=PC,PC.ID="editor.controller.parameterHints",PC);px=_Q=cut([fpe(1,ht),fpe(2,nt)],px);class dut extends Xe{constructor(){super({id:"editor.action.triggerParameterHints",label:w("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:U.hasSignatureHelpProvider,kbOpts:{kbExpr:U.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=px.get(t);i==null||i.trigger({triggerKind:Uh.Invoke})}}pi(px.ID,px,2);Pe(dut);const Vne=175,Hne=zs.bindToContribution(px.get);Ue(new Hne({id:"closeParameterHints",precondition:Cy.Visible,handler:s=>s.cancel(),kbOpts:{weight:Vne,kbExpr:U.focus,primary:9,secondary:[1033]}}));Ue(new Hne({id:"showPrevParameterHint",precondition:ve.and(Cy.Visible,Cy.MultipleSignatures),handler:s=>s.previous(),kbOpts:{weight:Vne,kbExpr:U.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));Ue(new Hne({id:"showNextParameterHint",precondition:ve.and(Cy.Visible,Cy.MultipleSignatures),handler:s=>s.next(),kbOpts:{weight:Vne,kbExpr:U.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var uut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},hut=function(s,e){return function(t,i){e(t,i,s)}};class fut{constructor(e){this.instantiationService=e}init(...e){}}function gut(s,e){return class extends e{constructor(){super(...arguments),this._autorun=void 0}init(...i){this._autorun=wa((n,r)=>{const o=Za(s(),n);r.add(this.instantiationService.createInstance(o,...i))})}dispose(){var i;(i=this._autorun)==null||i.dispose()}}}function put(s){return EH()?gut(s,vQ):s()}let vQ=class extends fut{constructor(e,t){super(t),this.init(e)}};vQ=uut([hut(1,ht)],vQ);pi($T.ID,put(()=>$T),0);q("editor.placeholder.foreground",dje,w("placeholderForeground","Foreground color of the placeholder text in the editor."));var mut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},R2=function(s,e){return function(t,i){e(t,i,s)}};const Jx=new qe("renameInputVisible",!1,w("renameInputVisible","Whether the rename input widget is visible"));new qe("renameInputFocused",!1,w("renameInputFocused","Whether the rename input widget is focused"));let bQ=class{constructor(e,t,i,n,r,o){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=n,this._logService=o,this.allowEditorOverflow=!0,this._disposables=new me,this._visibleContextKey=Jx.bindTo(r),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new ur,this._inputWithButton=new _ut,this._disposables.add(this._inputWithButton),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(50)&&this._updateFont()})),this._disposables.add(i.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._domNode.appendChild(this._inputWithButton.domNode),this._renameCandidateListView=this._disposables.add(new $ne(this._domNode,{fontInfo:this._editor.getOption(50),onFocusChange:e=>{this._inputWithButton.input.value=e,this._isEditingRenameCandidate=!1},onSelectionChange:()=>{this._isEditingRenameCandidate=!1,this.acceptInput(!1)}})),this._disposables.add(this._inputWithButton.onDidInputChange(()=>{var e,t,i;((e=this._renameCandidateListView)==null?void 0:e.focusedCandidate)!==void 0&&(this._isEditingRenameCandidate=!0),this._timeBeforeFirstInputFieldEdit??(this._timeBeforeFirstInputFieldEdit=this._beforeFirstInputFieldEditSW.elapsed()),((t=this._renameCandidateProvidersCts)==null?void 0:t.token.isCancellationRequested)===!1&&this._renameCandidateProvidersCts.cancel(),(i=this._renameCandidateListView)==null||i.clearFocus()})),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){if(!this._domNode)return;const t=e.getColor(Px),i=e.getColor(OCe);this._domNode.style.backgroundColor=String(e.getColor(Ul)??""),this._domNode.style.boxShadow=t?` 0 0 8px 2px ${t}`:"",this._domNode.style.border=i?`1px solid ${i}`:"",this._domNode.style.color=String(e.getColor(BCe)??"");const n=e.getColor(WCe);this._inputWithButton.domNode.style.backgroundColor=String(e.getColor(MK)??""),this._inputWithButton.input.style.backgroundColor=String(e.getColor(MK)??""),this._inputWithButton.domNode.style.borderWidth=n?"1px":"0px",this._inputWithButton.domNode.style.borderStyle=n?"solid":"none",this._inputWithButton.domNode.style.borderColor=(n==null?void 0:n.toString())??"none"}_updateFont(){if(this._domNode===void 0)return;yi(this._label!==void 0,"RenameWidget#_updateFont: _label must not be undefined given _domNode is defined"),this._editor.applyFontInfo(this._inputWithButton.input);const e=this._editor.getOption(50);this._label.style.fontSize=`${this._computeLabelFontSize(e.fontSize)}px`}_computeLabelFontSize(e){return e*.8}getPosition(){if(!this._visible||!this._editor.hasModel()||!this._editor.getDomNode())return null;const e=a_(this.getDomNode().ownerDocument.body),t=is(this._editor.getDomNode()),i=this._getTopForPosition();this._nPxAvailableAbove=i+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const n=this._editor.getOption(67),{totalHeight:r}=zT.getLayoutInfo({lineHeight:n}),o=this._nPxAvailableBelow>r*6?[2,1]:[1,2];return{position:this._position,preference:o}}beforeRender(){var i,n;const[e,t]=this._acceptKeybindings;return this._label.innerText=w({key:"label",comment:['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"']},"{0} to Rename, {1} to Preview",(i=this._keybindingService.lookupKeybinding(e))==null?void 0:i.getLabel(),(n=this._keybindingService.lookupKeybinding(t))==null?void 0:n.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(e){if(e===null){this.cancelInput(!0,"afterRender (because position is null)");return}if(!this._editor.hasModel()||!this._editor.getDomNode())return;yi(this._renameCandidateListView),yi(this._nPxAvailableAbove!==void 0),yi(this._nPxAvailableBelow!==void 0);const t=lg(this._inputWithButton.domNode),i=lg(this._label);let n;e===2?n=this._nPxAvailableBelow:n=this._nPxAvailableAbove,this._renameCandidateListView.layout({height:n-i-t,width:Ga(this._inputWithButton.domNode)})}acceptInput(e){var t;this._trace("invoking acceptInput"),(t=this._currentAcceptInput)==null||t.call(this,e)}cancelInput(e,t){var i;(i=this._currentCancelInput)==null||i.call(this,e)}focusNextRenameSuggestion(){var e;(e=this._renameCandidateListView)!=null&&e.focusNext()||(this._inputWithButton.input.value=this._currentName)}focusPreviousRenameSuggestion(){var e;(e=this._renameCandidateListView)!=null&&e.focusPrevious()||(this._inputWithButton.input.value=this._currentName)}getInput(e,t,i,n,r){const{start:o,end:a}=this._getSelection(e,t);this._renameCts=r;const l=new me;this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,n===void 0?this._inputWithButton.button.style.display="none":(this._inputWithButton.button.style.display="flex",this._requestRenameCandidatesOnce=n,this._requestRenameCandidates(t,!1),l.add(ue(this._inputWithButton.button,"click",()=>this._requestRenameCandidates(t,!0))),l.add(ue(this._inputWithButton.button,Ae.KEY_DOWN,h=>{const f=new rn(h);(f.equals(3)||f.equals(10))&&(f.stopPropagation(),f.preventDefault(),this._requestRenameCandidates(t,!0))}))),this._isEditingRenameCandidate=!1,this._domNode.classList.toggle("preview",i),this._position=new ie(e.startLineNumber,e.startColumn),this._currentName=t,this._inputWithButton.input.value=t,this._inputWithButton.input.setAttribute("selectionStart",o.toString()),this._inputWithButton.input.setAttribute("selectionEnd",a.toString()),this._inputWithButton.input.size=Math.max((e.endColumn-e.startColumn)*1.1,20),this._beforeFirstInputFieldEditSW.reset(),l.add(ut(()=>{this._renameCts=void 0,r.dispose(!0)})),l.add(ut(()=>{this._renameCandidateProvidersCts!==void 0&&(this._renameCandidateProvidersCts.dispose(!0),this._renameCandidateProvidersCts=void 0)})),l.add(ut(()=>this._candidates.clear()));const d=new Ix;return d.p.finally(()=>{l.dispose(),this._hide()}),this._currentCancelInput=h=>{var f;return this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,(f=this._renameCandidateListView)==null||f.clearCandidates(),d.complete(h),!0},this._currentAcceptInput=h=>{this._trace("invoking _currentAcceptInput"),yi(this._renameCandidateListView!==void 0);const f=this._renameCandidateListView.nCandidates;let p,m;const v=this._renameCandidateListView.focusedCandidate;if(v!==void 0?(this._trace("using new name from renameSuggestion"),p=v,m={k:"renameSuggestion"}):(this._trace("using new name from inputField"),p=this._inputWithButton.input.value,m=this._isEditingRenameCandidate?{k:"userEditedRenameSuggestion"}:{k:"inputField"}),p===t||p.trim().length===0){this.cancelInput(!0,"_currentAcceptInput (because newName === value || newName.trim().length === 0)");return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView.clearCandidates(),d.complete({newName:p,wantsPreview:i&&h,stats:{source:m,nRenameSuggestions:f,timeBeforeFirstInputFieldEdit:this._timeBeforeFirstInputFieldEdit,nRenameSuggestionsInvocations:this._nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:this._hadAutomaticRenameSuggestionsInvocation}})},l.add(r.token.onCancellationRequested(()=>this.cancelInput(!0,"cts.token.onCancellationRequested"))),l.add(this._editor.onDidBlurEditorWidget(()=>{var h;return this.cancelInput(!((h=this._domNode)!=null&&h.ownerDocument.hasFocus()),"editor.onDidBlurEditorWidget")})),this._show(),d.p}_requestRenameCandidates(e,t){if(this._requestRenameCandidatesOnce!==void 0&&(this._renameCandidateProvidersCts!==void 0&&this._renameCandidateProvidersCts.dispose(!0),yi(this._renameCts),this._inputWithButton.buttonState!=="stop")){this._renameCandidateProvidersCts=new Bn;const i=t?kE.Invoke:kE.Automatic,n=this._requestRenameCandidatesOnce(i,this._renameCandidateProvidersCts.token);if(n.length===0){this._inputWithButton.setSparkleButton();return}t||(this._hadAutomaticRenameSuggestionsInvocation=!0),this._nRenameSuggestionsInvocations+=1,this._inputWithButton.setStopButton(),this._updateRenameCandidates(n,e,this._renameCts.token)}}_getSelection(e,t){yi(this._editor.hasModel());const i=this._editor.getSelection();let n=0,r=t.length;return!W.isEmpty(i)&&!W.spansMultipleLines(i)&&W.containsRange(e,i)&&(n=Math.max(0,i.startColumn-e.startColumn),r=Math.min(e.endColumn,i.endColumn)-e.startColumn),{start:n,end:r}}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._inputWithButton.input.focus(),this._inputWithButton.input.setSelectionRange(parseInt(this._inputWithButton.input.getAttribute("selectionStart")),parseInt(this._inputWithButton.input.getAttribute("selectionEnd")))},100)}async _updateRenameCandidates(e,t,i){const n=(...d)=>this._trace("_updateRenameCandidates",...d);n("start");const r=await _N(Promise.allSettled(e),i);if(this._inputWithButton.setSparkleButton(),r===void 0){n("returning early - received updateRenameCandidates results - undefined");return}const o=r.flatMap(d=>d.status==="fulfilled"&&jh(d.value)?d.value:[]);n(`received updateRenameCandidates results - total (unfiltered) ${o.length} candidates.`);const a=Mg(o,d=>d.newSymbolName);n(`distinct candidates - ${a.length} candidates.`);const l=a.filter(({newSymbolName:d})=>d.trim().length>0&&d!==this._inputWithButton.input.value&&d!==t&&!this._candidates.has(d));if(n(`valid distinct candidates - ${o.length} candidates.`),l.forEach(d=>this._candidates.add(d.newSymbolName)),l.length<1){n("returning early - no valid distinct candidates");return}n("setting candidates"),this._renameCandidateListView.setCandidates(l),n("asking editor to re-layout"),this._editor.layoutContentWidget(this)}_hide(){this._trace("invoked _hide"),this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}_getTopForPosition(){const e=this._editor.getVisibleRanges();let t;return e.length>0?t=e[0].startLineNumber:(this._logService.warn("RenameWidget#_getTopForPosition: this should not happen - visibleRanges is empty"),t=Math.max(1,this._position.lineNumber-5)),this._editor.getTopForLineNumber(this._position.lineNumber)-this._editor.getTopForLineNumber(t)}_trace(...e){this._logService.trace("RenameWidget",...e)}};bQ=mut([R2(2,js),R2(3,Ri),R2(4,wt),R2(5,Gr)],bQ);class $ne{constructor(e,t){this._disposables=new me,this._availableHeight=0,this._minimumWidth=0,this._lineHeight=t.fontInfo.lineHeight,this._typicalHalfwidthCharacterWidth=t.fontInfo.typicalHalfwidthCharacterWidth,this._listContainer=document.createElement("div"),this._listContainer.className="rename-box rename-candidate-list-container",e.appendChild(this._listContainer),this._listWidget=$ne._createListWidget(this._listContainer,this._candidateViewHeight,t.fontInfo),this._listWidget.onDidChangeFocus(i=>{i.elements.length===1&&t.onFocusChange(i.elements[0].newSymbolName)},this._disposables),this._listWidget.onDidChangeSelection(i=>{i.elements.length===1&&t.onSelectionChange()},this._disposables),this._disposables.add(this._listWidget.onDidBlur(i=>{this._listWidget.setFocus([])})),this._listWidget.style(By({listInactiveFocusForeground:HE,listInactiveFocusBackground:$E}))}dispose(){this._listWidget.dispose(),this._disposables.dispose()}layout({height:e,width:t}){this._availableHeight=e,this._minimumWidth=t}setCandidates(e){this._listWidget.splice(0,0,e);const t=this._pickListHeight(this._listWidget.length),i=this._pickListWidth(e);this._listWidget.layout(t,i),this._listContainer.style.height=`${t}px`,this._listContainer.style.width=`${i}px`,ef(w("renameSuggestionsReceivedAria","Received {0} rename suggestions",e.length))}clearCandidates(){this._listContainer.style.height="0px",this._listContainer.style.width="0px",this._listWidget.splice(0,this._listWidget.length,[])}get nCandidates(){return this._listWidget.length}get focusedCandidate(){if(this._listWidget.length===0)return;const e=this._listWidget.getSelectedElements()[0];if(e!==void 0)return e.newSymbolName;const t=this._listWidget.getFocusedElements()[0];if(t!==void 0)return t.newSymbolName}focusNext(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0)return this._listWidget.focusFirst(),this._listWidget.reveal(0),!0;if(e[0]===this._listWidget.length-1)return this._listWidget.setFocus([]),this._listWidget.reveal(0),!1;{this._listWidget.focusNext();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}focusPrevious(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0){this._listWidget.focusLast();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}else{if(e[0]===0)return this._listWidget.setFocus([]),!1;{this._listWidget.focusPrevious();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}}clearFocus(){this._listWidget.setFocus([])}get _candidateViewHeight(){const{totalHeight:e}=zT.getLayoutInfo({lineHeight:this._lineHeight});return e}_pickListHeight(e){const t=this._candidateViewHeight*e;return Math.min(t,this._availableHeight,this._candidateViewHeight*7)}_pickListWidth(e){const t=Math.ceil(Math.max(...e.map(n=>n.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,25+t+10)}static _createListWidget(e,t,i){const n=new class{getTemplateId(o){return"candidate"}getHeight(o){return t}},r=new class{constructor(){this.templateId="candidate"}renderTemplate(o){return new zT(o,i)}renderElement(o,a,l){l.populate(o)}disposeTemplate(o){o.dispose()}};return new oc("NewSymbolNameCandidates",e,n,[r],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}}class _ut{constructor(){this._onDidInputChange=new se,this.onDidInputChange=this._onDidInputChange.event,this._disposables=new me}get domNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="rename-input-with-button",this._domNode.style.display="flex",this._domNode.style.flexDirection="row",this._domNode.style.alignItems="center",this._inputNode=document.createElement("input"),this._inputNode.className="rename-input",this._inputNode.type="text",this._inputNode.style.border="none",this._inputNode.setAttribute("aria-label",w("renameAriaLabel","Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._inputNode),this._buttonNode=document.createElement("div"),this._buttonNode.className="rename-suggestions-button",this._buttonNode.setAttribute("tabindex","0"),this._buttonGenHoverText=w("generateRenameSuggestionsButton","Generate new name suggestions"),this._buttonCancelHoverText=w("cancelRenameSuggestionsButton","Cancel"),this._buttonHover=qu().setupManagedHover(ia("element"),this._buttonNode,this._buttonGenHoverText),this._disposables.add(this._buttonHover),this._domNode.appendChild(this._buttonNode),this._disposables.add(ue(this.input,Ae.INPUT,()=>this._onDidInputChange.fire())),this._disposables.add(ue(this.input,Ae.KEY_DOWN,e=>{const t=new rn(e);(t.keyCode===15||t.keyCode===17)&&this._onDidInputChange.fire()})),this._disposables.add(ue(this.input,Ae.CLICK,()=>this._onDidInputChange.fire())),this._disposables.add(ue(this.input,Ae.FOCUS,()=>{this.domNode.style.outlineWidth="1px",this.domNode.style.outlineStyle="solid",this.domNode.style.outlineOffset="-1px",this.domNode.style.outlineColor="var(--vscode-focusBorder)"})),this._disposables.add(ue(this.input,Ae.BLUR,()=>{this.domNode.style.outline="none"}))),this._domNode}get input(){return yi(this._inputNode),this._inputNode}get button(){return yi(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){var e;this._buttonState="sparkle",this._sparkleIcon??(this._sparkleIcon=iy(Oe.sparkle)),kr(this.button),this.button.appendChild(this._sparkleIcon),this.button.setAttribute("aria-label","Generating new name suggestions"),(e=this._buttonHover)==null||e.update(this._buttonGenHoverText),this.input.focus()}setStopButton(){var e;this._buttonState="stop",this._stopIcon??(this._stopIcon=iy(Oe.primitiveSquare)),kr(this.button),this.button.appendChild(this._stopIcon),this.button.setAttribute("aria-label","Cancel generating new name suggestions"),(e=this._buttonHover)==null||e.update(this._buttonCancelHoverText),this.input.focus()}dispose(){this._disposables.dispose()}}const aE=class aE{constructor(e,t){this._domNode=document.createElement("div"),this._domNode.className="rename-box rename-candidate",this._domNode.style.display="flex",this._domNode.style.columnGap="5px",this._domNode.style.alignItems="center",this._domNode.style.height=`${t.lineHeight}px`,this._domNode.style.padding=`${aE._PADDING}px`;const i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.width=i.style.height=`${t.lineHeight*.8}px`,this._domNode.appendChild(i),this._icon=iy(Oe.sparkle),this._icon.style.display="none",i.appendChild(this._icon),this._label=document.createElement("div"),Dr(this._label,t),this._domNode.appendChild(this._label),e.appendChild(this._domNode)}populate(e){this._updateIcon(e),this._updateLabel(e)}_updateIcon(e){var i;const t=!!((i=e.tags)!=null&&i.includes(zU.AIGenerated));this._icon.style.display=t?"inherit":"none"}_updateLabel(e){this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+aE._PADDING*2}}dispose(){}};aE._PADDING=2;let zT=aE;var vut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Op=function(s,e){return function(t,i){e(t,i,s)}},CQ;class zne{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(e){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx<this._providers.length;this._providerRenameIdx++){const n=this._providers[this._providerRenameIdx];if(!n.resolveRenameLocation)break;const r=await n.resolveRenameLocation(this.model,this.position,e);if(r){if(r.rejectReason){t.push(r.rejectReason);continue}return r}}this._providerRenameIdx=0;const i=this.model.getWordAtPosition(this.position);return i?{range:new W(this.position.lineNumber,i.startColumn,this.position.lineNumber,i.endColumn),text:i.word,rejectReason:t.length>0?t.join(`
|
|
950
950
|
`):void 0}:{range:W.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(`
|
|
951
951
|
`):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,n){const r=this._providers[t];if(!r)return{edits:[],rejectReason:i.join(`
|
|
952
|
-
`)};const o=await r.provideRenameEdits(this.model,this.position,e,n);if(o){if(o.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(o.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(w("no result","No result.")),n);return o}}async function but(s,e,t,i){const n=new zne(e,t,s),r=await n.resolveRenameLocation(zt.None);return r!=null&&r.rejectReason?{edits:[],rejectReason:r.rejectReason}:n.provideRenameEdits(i,zt.None)}var OC;let C_=(OC=class{static get(e){return e.getContribution(CQ.ID)}constructor(e,t,i,n,r,o,a,l,d){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=r,this._logService=o,this._configService=a,this._languageFeaturesService=l,this._telemetryService=d,this._disposableStore=new me,this._cts=new Bn,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(bQ,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var v,b;const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new Bn,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new zne(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const n=new m_(this.editor,5,void 0,this._cts.token);let r;try{e("resolving rename location");const y=i.resolveRenameLocation(n.token);this._progressService.showWhile(y,250),r=await y,e("resolved rename location")}catch(y){y instanceof Ed?e("resolve rename location cancelled",JSON.stringify(y,null," ")):(e("resolve rename location failed",y instanceof Error?y:JSON.stringify(y,null," ")),(typeof y=="string"||Mu(y))&&((v=al.get(this.editor))==null||v.showMessage(y||w("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),t)));return}finally{n.dispose()}if(!r){e("returning early - no loc");return}if(r.rejectReason){e(`returning early - rejected with reason: ${r.rejectReason}`,r.rejectReason),(b=al.get(this.editor))==null||b.showMessage(r.rejectReason,t);return}if(n.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const o=new m_(this.editor,5,r.range,this._cts.token),a=this.editor.getModel(),l=this._languageFeaturesService.newSymbolNamesProvider.all(a),d=await Promise.all(l.map(async y=>[y,await y.supportsAutomaticNewSymbolNamesTriggerKind??!1])),h=(y,x)=>{let D=d.slice();return y===kE.Automatic&&(D=D.filter(([S,I])=>I)),D.map(([S])=>S.provideNewSymbolNames(a,r.range,y,x))};e("creating rename input field and awaiting its result");const f=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),p=await this._renameWidget.getInput(r.range,r.text,f,l.length>0?h:void 0,o);if(e("received response from rename input field"),l.length>0&&this._reportTelemetry(l.length,a.getLanguageId(),p),typeof p=="boolean"){e(`returning early - rename input field response - ${p}`),p&&this.editor.focus(),o.dispose();return}this.editor.focus(),e("requesting rename edits");const m=_N(i.provideRenameEdits(p.newName,o.token),o.token).then(async y=>{if(!y){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(y.rejectReason){e(`returning early - rejected with reason: ${y.rejectReason}`),this._notificationService.info(y.rejectReason);return}this.editor.setSelection(W.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(y,{editor:this.editor,showPreview:p.wantsPreview,label:w("label","Renaming '{0}' to '{1}'",r==null?void 0:r.text,p.newName),code:"undoredo.rename",quotableLabel:w("quotableLabel","Renaming {0} to {1}",r==null?void 0:r.text,p.newName),respectAutoSaveConfig:!0}).then(x=>{e("edits applied"),x.ariaSummary&&Jo(w("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",r.text,p.newName,x.ariaSummary))}).catch(x=>{e(`error when applying edits ${JSON.stringify(x,null," ")}`),this._notificationService.error(w("rename.failedApply","Rename failed to apply edits")),this._logService.error(x)})},y=>{e("error when providing rename edits",JSON.stringify(y,null," ")),this._notificationService.error(w("rename.failed","Rename failed to compute edits")),this._logService.error(y)}).finally(()=>{o.dispose()});return e("returning rename operation"),this._progressService.showWhile(m,250),m}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}_reportTelemetry(e,t,i){const n=typeof i=="boolean"?{kind:"cancelled",languageId:t,nRenameSuggestionProviders:e}:{kind:"accepted",languageId:t,nRenameSuggestionProviders:e,source:i.stats.source.k,nRenameSuggestions:i.stats.nRenameSuggestions,timeBeforeFirstInputFieldEdit:i.stats.timeBeforeFirstInputFieldEdit,wantsPreview:i.wantsPreview,nRenameSuggestionsInvocations:i.stats.nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:i.stats.hadAutomaticRenameSuggestionsInvocation};this._telemetryService.publicLog2("renameInvokedEvent",n)}},CQ=OC,OC.ID="editor.contrib.renameController",OC);C_=CQ=vut([Op(1,ht),Op(2,ps),Op(3,kN),Op(4,D_),Op(5,Gr),Op(6,$V),Op(7,nt),Op(8,oo)],C_);class Cut extends Xe{constructor(){super({id:"editor.action.rename",label:w("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:ve.and(U.writable,U.hasRenameProvider),kbOpts:{kbExpr:U.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(wi),[n,r]=Array.isArray(t)&&t||[void 0,void 0];return pt.isUri(n)&&ie.isIPosition(r)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(o=>{o&&(o.setPosition(r),o.invokeWithinContext(a=>(this.reportTelemetry(a,o),this.run(a,o))))},Nt):super.runCommand(e,t)}run(e,t){const i=e.get(Gr),n=C_.get(t);return n?(i.trace("[RenameAction] got controller, running..."),n.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}pi(C_.ID,C_,4);Pe(Cut);const jne=zs.bindToContribution(C_.get);Ue(new jne({id:"acceptRenameInput",precondition:Jx,handler:s=>s.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:ve.and(U.focus,ve.not("isComposing")),primary:3}}));Ue(new jne({id:"acceptRenameInputWithPreview",precondition:ve.and(Jx,ve.has("config.editor.rename.enablePreview")),handler:s=>s.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:ve.and(U.focus,ve.not("isComposing")),primary:2051}}));Ue(new jne({id:"cancelRenameInput",precondition:Jx,handler:s=>s.cancelRenameInput(),kbOpts:{weight:199,kbExpr:U.focus,primary:9,secondary:[1033]}}));on(class extends ta{constructor(){super({id:"focusNextRenameSuggestion",title:{...Lt("focusNextRenameSuggestion","Focus Next Rename Suggestion")},precondition:Jx,keybinding:[{primary:18,weight:199}]})}run(e){const t=e.get(wi).getFocusedCodeEditor();if(!t)return;const i=C_.get(t);i&&i.focusNextRenameSuggestion()}});on(class extends ta{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...Lt("focusPreviousRenameSuggestion","Focus Previous Rename Suggestion")},precondition:Jx,keybinding:[{primary:16,weight:199}]})}run(e){const t=e.get(wi).getFocusedCodeEditor();if(!t)return;const i=C_.get(t);i&&i.focusPreviousRenameSuggestion()}});Ea("_executeDocumentRenameProvider",function(s,e,t,...i){const[n]=i;yi(typeof n=="string");const{renameProvider:r}=s.get(nt);return but(r,e,t,n)});Ea("_executePrepareRename",async function(s,e,t){const{renameProvider:i}=s.get(nt),r=await new zne(e,t,i).resolveRenameLocation(zt.None);if(r!=null&&r.rejectReason)throw new Error(r.rejectReason);return r});Wn.as(Bd.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:w("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var yut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},gpe=function(s,e){return function(t,i){e(t,i,s)}},wS;let J3=(wS=class extends re{constructor(e,t,i){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=i,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(73)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(n=>{var o;const r=(o=this.editor.getModel())==null?void 0:o.getLanguageId();r&&n.affects(r)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(n=>{this.options&&!n.hasChanged(73)||(this.options=this.createOptions(e.getOption(73)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(n=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(n=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new Ui(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const i=this.languageConfigurationService.getLanguageConfiguration(t).comments,n=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!i&&!(n!=null&&n.markers)))return{foldingRules:n,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){var i,n;if(!this.editor.hasModel()||!((i=this.options)!=null&&i.findMarkSectionHeaders)&&!((n=this.options)!=null&&n.findRegionSectionHeaders))return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(r=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(r)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(r=>{if(!r.shouldBeInComments)return!0;const o=t.validateRange(r.range),a=t.tokenization.getLineTokens(o.startLineNumber),l=a.findTokenIndexAtOffset(o.startColumn-1),d=a.getStandardTokenType(l);return a.getLanguageId(l)===t.getLanguageId()&&d===1}));const i=Object.values(this.currentOccurrences).map(r=>r.decorationId),n=e.map(r=>wut(r));this.editor.changeDecorations(r=>{const o=r.deltaDecorations(i,n);this.currentOccurrences={};for(let a=0,l=o.length;a<l;a++){const d={sectionHeader:e[a],decorationId:o[a]};this.currentOccurrences[d.decorationId]=d}})}stop(){this.computeSectionHeaders.cancel(),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop(),this.decorations.clear()}},wS.ID="editor.sectionHeaderDetector",wS);J3=yut([gpe(1,Vn),gpe(2,Na)],J3);function wut(s){return{range:s.range,options:At.createDynamic({description:"section-header",stickiness:3,collapseOnReplaceEdit:!0,minimap:{color:void 0,position:1,sectionHeaderStyle:s.hasSeparatorLine?2:1,sectionHeaderText:s.text}})}}pi(J3.ID,J3,1);function Sut(s){for(let e=0,t=s.length;e<t;e+=4){const i=s[e+0],n=s[e+1],r=s[e+2],o=s[e+3];s[e+0]=o,s[e+1]=r,s[e+2]=n,s[e+3]=i}}function xut(s){const e=new Uint8Array(s.buffer,s.byteOffset,s.length*4);return Eve()||Sut(e),WV.wrap(e)}function vxe(s){const e=new Uint32Array(kut(s));let t=0;if(e[t++]=s.id,s.type==="full")e[t++]=1,e[t++]=s.data.length,e.set(s.data,t),t+=s.data.length;else{e[t++]=2,e[t++]=s.deltas.length;for(const i of s.deltas)e[t++]=i.start,e[t++]=i.deleteCount,i.data?(e[t++]=i.data.length,e.set(i.data,t),t+=i.data.length):e[t++]=0}return xut(e)}function kut(s){let e=0;if(e+=2,s.type==="full")e+=1+s.data.length;else{e+=1,e+=3*s.deltas.length;for(const t of s.deltas)t.data&&(e+=t.data.length)}return e}function XH(s){return s&&!!s.data}function bxe(s){return s&&Array.isArray(s.edits)}class Lut{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function Cxe(s,e){return s.has(e)}function Dut(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function yxe(s,e,t,i,n){const r=Dut(s,e),o=await Promise.all(r.map(async a=>{let l,d=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?i:null,n)}catch(h){d=h,l=null}return(!l||!XH(l)&&!bxe(l))&&(l=null),new Lut(a,l,d)}));for(const a of o){if(a.error)throw a.error;if(a.tokens)return a}return o.length>0?o[0]:null}function Iut(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:null}class Eut{constructor(e,t){this.provider=e,this.tokens=t}}function Tut(s,e){return s.has(e)}function wxe(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function Une(s,e,t,i){const n=wxe(s,e),r=await Promise.all(n.map(async o=>{let a;try{a=await o.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){ns(l),a=null}return(!a||!XH(a))&&(a=null),new Eut(o,a)}));for(const o of r)if(o.tokens)return o;return r.length>0?r[0]:null}fi.registerCommand("_provideDocumentSemanticTokensLegend",async(s,...e)=>{const[t]=e;yi(t instanceof pt);const i=s.get(_n).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(nt),r=Iut(n,i);return r?r[0].getLegend():s.get(ln).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});fi.registerCommand("_provideDocumentSemanticTokens",async(s,...e)=>{const[t]=e;yi(t instanceof pt);const i=s.get(_n).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(nt);if(!Cxe(n,i))return s.get(ln).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const r=await yxe(n,i,null,null,zt.None);if(!r)return;const{provider:o,tokens:a}=r;if(!a||!XH(a))return;const l=vxe({id:0,type:"full",data:a.data});return a.resultId&&o.releaseDocumentSemanticTokens(a.resultId),l});fi.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(s,...e)=>{const[t,i]=e;yi(t instanceof pt);const n=s.get(_n).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:r}=s.get(nt),o=wxe(r,n);if(o.length===0)return;if(o.length===1)return o[0].getLegend();if(!i||!W.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),o[0].getLegend();const a=await Une(r,n,W.lift(i),zt.None);if(a)return a.provider.getLegend()});fi.registerCommand("_provideDocumentRangeSemanticTokens",async(s,...e)=>{const[t,i]=e;yi(t instanceof pt),yi(W.isIRange(i));const n=s.get(_n).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:r}=s.get(nt),o=await Une(r,n,W.lift(i),zt.None);if(!(!o||!o.tokens))return vxe({id:0,type:"full",data:o.tokens.data})});const qne="editor.semanticHighlighting";function RF(s,e,t){var n;const i=(n=t.getValue(qne,{overrideIdentifier:s.getLanguageId(),resource:s.uri}))==null?void 0:n.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var Sxe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Ph=function(s,e){return function(t,i){e(t,i,s)}},Wp;let yQ=class extends re{constructor(e,t,i,n,r,o){super(),this._watchers=Object.create(null);const a=h=>{this._watchers[h.uri.toString()]=new wQ(h,e,i,r,o)},l=(h,f)=>{f.dispose(),delete this._watchers[h.uri.toString()]},d=()=>{for(const h of t.getModels()){const f=this._watchers[h.uri.toString()];RF(h,i,n)?f||a(h):f&&l(h,f)}};t.getModels().forEach(h=>{RF(h,i,n)&&a(h)}),this._register(t.onModelAdded(h=>{RF(h,i,n)&&a(h)})),this._register(t.onModelRemoved(h=>{const f=this._watchers[h.uri.toString()];f&&l(h,f)})),this._register(n.onDidChangeConfiguration(h=>{h.affectsConfiguration(qne)&&d()})),this._register(i.onDidColorThemeChange(d))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};yQ=Sxe([Ph(0,jV),Ph(1,_n),Ph(2,js),Ph(3,Gt),Ph(4,sc),Ph(5,nt)],yQ);var Gm;let wQ=(Gm=class extends re{constructor(e,t,i,n,r){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=r.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:Wp.REQUEST_MIN_DELAY,max:Wp.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new Ui(()=>this._fetchDocumentSemanticTokensNow(),Wp.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const o=()=>{Qi(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};o(),this._register(this._provider.onDidChange(()=>{o(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(a=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),Qi(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!Cxe(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new Bn,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=yxe(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const r=[],o=this._model.onDidChangeContent(l=>{r.push(l)}),a=new ur(!1);n.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,r);else{const{provider:d,tokens:h}=l,f=this._semanticTokensStylingService.getStyling(d);this._setDocumentSemanticTokens(d,h||null,f,r)}},l=>{l&&(zc(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||Nt(l),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),(r.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,n,r){r=Math.min(r,i.length-n,e.length-t);for(let o=0;o<r;o++)i[n+o]=e[t+o]}_setDocumentSemanticTokens(e,t,i,n){const r=this._currentDocumentResponse,o=()=>{(n.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),o();return}if(bxe(t)){if(!r){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:r.data};else{let a=0;for(const p of t.edits)a+=(p.data?p.data.length:0)-p.deleteCount;const l=r.data,d=new Uint32Array(l.length+a);let h=l.length,f=d.length;for(let p=t.edits.length-1;p>=0;p--){const m=t.edits[p];if(m.start>l.length){i.warnInvalidEditStart(r.resultId,t.resultId,p,m.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const v=h-(m.start+m.deleteCount);v>0&&(Wp._copy(l,h-v,d,f-v,v),f-=v),m.data&&(Wp._copy(m.data,0,d,f-m.data.length,m.data.length),f-=m.data.length),h=m.start}h>0&&Wp._copy(l,0,d,0,h),t={resultId:t.resultId,data:d}}}if(XH(t)){this._currentDocumentResponse=new Nut(e,t.resultId,t.data);const a=CCe(t,i,this._model.getLanguageId());if(n.length>0)for(const l of n)for(const d of a)for(const h of l.changes)d.applyEdit(h.range,h.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);o()}},Wp=Gm,Gm.REQUEST_MIN_DELAY=300,Gm.REQUEST_MAX_DELAY=2e3,Gm);wQ=Wp=Sxe([Ph(1,jV),Ph(2,js),Ph(3,sc),Ph(4,nt)],wQ);class Nut{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}Ux(yQ);var Mut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},kD=function(s,e){return function(t,i){e(t,i,s)}},SS;let eB=(SS=class extends re{constructor(e,t,i,n,r,o){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=o.documentRangeSemanticTokensProvider,this._debounceInformation=r.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new Ui(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(l=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(l=>{l.affectsConfiguration(qne)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;t<i;t++)if(this._outstandingRequests[t]===e){this._outstandingRequests.splice(t,1);return}}_tokenizeViewportNow(){if(!this._editor.hasModel())return;const e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!RF(e,this._themeService,this._configurationService)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}if(!Tut(this._provider,e)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}const t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map(i=>this._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),n=Xs(o=>Promise.resolve(Une(this._provider,e,t,o))),r=new ur(!1);return n.then(o=>{if(this._debounceInformation.update(e,r.elapsed()),!o||!o.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:l}=o,d=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,CCe(l,d,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}},SS.ID="editor.contrib.viewportSemanticTokens",SS);eB=Mut([kD(1,jV),kD(2,js),kD(3,Gt),kD(4,sc),kD(5,nt)],eB);pi(eB.ID,eB,1);class Rut{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const r=[];i.push(r),this.selectSubwords&&this._addInWordRanges(r,e,n),this._addWordRanges(r,e,n),this._addWhitespaceLine(r,e,n),r.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:r,startColumn:o}=n,a=i.column-o;let l=a,d=a,h=0;for(;l>=0;l--){const f=r.charCodeAt(l);if(l!==a&&(f===95||f===45))break;if(am(f)&&Th(h))break;h=f}for(l+=1;d<r.length;d++){const f=r.charCodeAt(d);if(Th(f)&&am(h))break;if(f===95||f===45)break;h=f}l<d&&e.push({range:new W(i.lineNumber,o+l,i.lineNumber,o+d)})}_addWordRanges(e,t,i){const n=t.getWordAtPosition(i);n&&e.push({range:new W(i.lineNumber,n.startColumn,i.lineNumber,n.endColumn)})}_addWhitespaceLine(e,t,i){t.getLineLength(i.lineNumber)>0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new W(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var Put=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Out=function(s,e){return function(t,i){e(t,i,s)}},SQ;class Kne{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new Kne(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}var AC;let jT=(AC=class{static get(e){return e.getContribution(SQ.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)==null||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await kxe(this._languageFeaturesService.selectionRangeProvider,i,t.map(r=>r.getPosition()),this._editor.getOption(114),zt.None).then(r=>{var o;if(!(!xo(r)||r.length!==t.length)&&!(!this._editor.hasModel()||!Mn(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;a<r.length;a++)r[a]=r[a].filter(l=>l.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),r[a].unshift(t[a]);this._state=r.map(a=>new Kne(0,a)),(o=this._selectionListener)==null||o.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)==null||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(r=>r.mov(e));const n=this._state.map(r=>lt.fromPositions(r.ranges[r.index].getStartPosition(),r.ranges[r.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}},SQ=AC,AC.ID="editor.contrib.smartSelectController",AC);jT=SQ=Put([Out(1,nt)],jT);class xxe extends Xe{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=jT.get(t);i&&await i.run(this._forward)}}class Aut extends xxe{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:w("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:rt.MenubarSelectionMenu,group:"1_basic",title:w({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}fi.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class Fut extends xxe{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:w("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:rt.MenubarSelectionMenu,group:"1_basic",title:w({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}pi(jT.ID,jT,4);Pe(Aut);Pe(Fut);async function kxe(s,e,t,i,n){const r=s.all(e).concat(new Rut(i.selectSubwords));r.length===1&&r.unshift(new B3);const o=[],a=[];for(const l of r)o.push(Promise.resolve(l.provideSelectionRanges(e,t,n)).then(d=>{if(xo(d)&&d.length===t.length)for(let h=0;h<t.length;h++){a[h]||(a[h]=[]);for(const f of d[h])W.isIRange(f.range)&&W.containsPosition(f.range,t[h])&&a[h].push(W.lift(f.range))}},ns));return await Promise.all(o),a.map(l=>{if(l.length===0)return[];l.sort((p,m)=>ie.isBefore(p.getStartPosition(),m.getStartPosition())?1:ie.isBefore(m.getStartPosition(),p.getStartPosition())||ie.isBefore(p.getEndPosition(),m.getEndPosition())?-1:ie.isBefore(m.getEndPosition(),p.getEndPosition())?1:0);const d=[];let h;for(const p of l)(!h||W.containsRange(p,h)&&!W.equalsRange(p,h))&&(d.push(p),h=p);if(!i.selectLeadingAndTrailingWhitespace)return d;const f=[d[0]];for(let p=1;p<d.length;p++){const m=d[p-1],v=d[p];if(v.startLineNumber!==m.startLineNumber||v.endLineNumber!==m.endLineNumber){const b=new W(m.startLineNumber,e.getLineFirstNonWhitespaceColumn(m.startLineNumber),m.endLineNumber,e.getLineLastNonWhitespaceColumn(m.endLineNumber));b.containsRange(m)&&!b.equalsRange(m)&&v.containsRange(b)&&!v.equalsRange(b)&&f.push(b);const y=new W(m.startLineNumber,1,m.endLineNumber,e.getLineMaxColumn(m.endLineNumber));y.containsRange(m)&&!y.equalsRange(b)&&v.containsRange(y)&&!v.equalsRange(y)&&f.push(y)}f.push(v)}return f})}fi.registerCommand("_executeSelectionRangeProvider",async function(s,...e){const[t,i]=e;yi(pt.isUri(t));const n=s.get(nt).selectionRangeProvider,r=await s.get(Ia).createModelReference(t);try{return kxe(n,r.object.textEditorModel,i,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},zt.None)}finally{r.dispose()}});const But=Object.freeze({View:Lt("view","View"),Help:Lt("help","Help"),Test:Lt("test","Test"),File:Lt("file","File"),Preferences:Lt("preferences","Preferences"),Developer:Lt({key:"developer",comment:["A developer on Code itself or someone diagnosing issues in Code"]},"Developer")});class VI{constructor(e,t,i,n=null){this.startLineNumbers=e,this.endLineNumbers=t,this.lastLineRelativePosition=i,this.showEndForLine=n}equals(e){return!!e&&this.lastLineRelativePosition===e.lastLineRelativePosition&&this.showEndForLine===e.showEndForLine&&Mn(this.startLineNumbers,e.startLineNumbers)&&Mn(this.endLineNumbers,e.endLineNumbers)}static get Empty(){return new VI([],[],0)}}const ppe=Kg("stickyScrollViewLayer",{createHTML:s=>s}),Oj="data-sticky-line-index",mpe="data-sticky-is-line",Wut="data-sticky-is-line-number",_pe="data-sticky-is-folding-icon";class Vut extends re{constructor(e){super(),this._editor=e,this._foldingIconStore=new me,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(67),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof Od),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(116).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(116)&&t(),i.hasChanged(67)&&(this._lineHeight=this._editor.getOption(67))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(i=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getRenderedStickyLine(e){return this._renderedStickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i){if(i===void 0&&(!this._previousState&&!e||this._previousState&&this._previousState.equals(e)))return;const n=this._isWidgetHeightZero(e),r=n?void 0:e,o=n?0:this._findLineToRebuildWidgetFrom(e,i);this._renderRootNode(r,t,o),this._previousState=e}_isWidgetHeightZero(e){if(!e)return!0;const t=e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition;if(t>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const i=[...e.startLineNumbers];e.showEndForLine!==null&&(i[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=i}else this._lastLineRelativePosition=0,this._lineNumbers=[];return t===0}_findLineToRebuildWidgetFrom(e,t){if(!e||!this._previousState)return 0;if(t!==void 0)return t;const i=this._previousState,n=e.startLineNumbers.findIndex(r=>!i.startLineNumbers.includes(r));return n===-1?0:n}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_clearStickyLinesFromLine(e){this._foldingIconStore.clear();for(let t=e;t<this._renderedStickyLines.length;t++){const i=this._renderedStickyLines[t];i.lineNumberDomNode.remove(),i.lineDomNode.remove()}this._renderedStickyLines=this._renderedStickyLines.slice(0,e),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._renderedStickyLines){const i=t.foldingIcon;i&&i.setVisible(e?!0:i.isCollapsed)}}async _renderRootNode(e,t,i){if(this._clearStickyLinesFromLine(i),!e)return;for(const a of this._renderedStickyLines)this._updateTopAndZIndexOfStickyLine(a);const n=this._editor.getLayoutInfo(),r=this._lineNumbers.slice(i);for(const[a,l]of r.entries()){const d=this._renderChildNode(a+i,l,t,n);d&&(this._linesDomNode.appendChild(d.lineDomNode),this._lineNumbersDomNode.appendChild(d.lineNumberDomNode),this._renderedStickyLines.push(d))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const o=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${o}px`,this._linesDomNodeScrollable.style.height=`${o}px`,this._rootDomNode.style.height=`${o}px`,this._rootDomNode.style.marginLeft="0px",this._minContentWidthInPx=Math.max(...this._renderedStickyLines.map(a=>a.scrollWidth))+n.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(111)==="mouseover"&&(this._foldingIconStore.add(ue(this._lineNumbersDomNode,Ae.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(ue(this._lineNumbersDomNode,Ae.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,n){const r=this._editor._getViewModel();if(!r)return;const o=r.coordinatesConverter.convertModelPositionToViewPosition(new ie(t,1)).lineNumber,a=r.getViewLineRenderingData(o),l=this._editor.getOption(68);let d;try{d=jo.filter(a.inlineDecorations,o,a.minColumn,a.maxColumn)}catch{d=[]}const h=new N_(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,d,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),f=new Mx(2e3),p=FN(h,f);let m;ppe?m=ppe.createHTML(f.build()):m=f.build();const v=document.createElement("span");v.setAttribute(Oj,String(e)),v.setAttribute(mpe,""),v.setAttribute("role","listitem"),v.tabIndex=0,v.className="sticky-line-content",v.classList.add(`stickyLine${t}`),v.style.lineHeight=`${this._lineHeight}px`,v.innerHTML=m;const b=document.createElement("span");b.setAttribute(Oj,String(e)),b.setAttribute(Wut,""),b.className="sticky-line-number",b.style.lineHeight=`${this._lineHeight}px`;const y=n.contentLeft;b.style.width=`${y}px`;const x=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?x.innerText=t.toString():l.renderType===2&&(x.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),x.className="sticky-line-number-inner",x.style.lineHeight=`${this._lineHeight}px`,x.style.width=`${n.lineNumbersWidth}px`,x.style.paddingLeft=`${n.lineNumbersLeft}px`,b.appendChild(x);const D=this._renderFoldingIconForLine(i,t);D&&b.appendChild(D.domNode),this._editor.applyFontInfo(v),this._editor.applyFontInfo(x),b.style.lineHeight=`${this._lineHeight}px`,v.style.lineHeight=`${this._lineHeight}px`,b.style.height=`${this._lineHeight}px`,v.style.height=`${this._lineHeight}px`;const S=new Hut(e,t,v,b,D,p.characterMapping,v.scrollWidth);return this._updateTopAndZIndexOfStickyLine(S)}_updateTopAndZIndexOfStickyLine(e){var h;const t=e.index,i=e.lineDomNode,n=e.lineNumberDomNode,r=t===this._lineNumbers.length-1,o="0",a="1";i.style.zIndex=r?o:a,n.style.zIndex=r?o:a;const l=`${t*this._lineHeight+this._lastLineRelativePosition+((h=e.foldingIcon)!=null&&h.isCollapsed?1:0)}px`,d=`${t*this._lineHeight}px`;return i.style.top=r?l:d,n.style.top=r?l:d,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(111);if(!e||i==="never")return;const n=e.regions,r=n.findRange(t),o=n.getStartLineNumber(r);if(!(t===o))return;const l=n.isCollapsed(r),d=new $ut(l,o,n.getEndLineNumber(r),this._lineHeight);return d.setVisible(this._isOnGlyphMargin?!0:l||i==="always"),d.domNode.setAttribute(_pe,""),d}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:2,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e<this._renderedStickyLines.length&&this._renderedStickyLines[e].lineDomNode.focus()}getEditorPositionFromNode(e){if(!e||e.children.length>0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=yie(t.characterMapping,e,0);return new ie(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t;return((t=this._getRenderedStickyLineFromChildDomNode(e))==null?void 0:t.lineNumber)??null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._renderedStickyLines.length?null:this._renderedStickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,Oj);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,mpe)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,_pe)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class Hut{constructor(e,t,i,n,r,o,a){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=r,this.characterMapping=o,this.scrollWidth=a}}class $ut{constructor(e,t,i,n){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=n,this.domNode=document.createElement("div"),this.domNode.style.width=`${n}px`,this.domNode.style.height=`${n}px`,this.domNode.className=Ct.asClassName(e?D3:L3)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class HI{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class tB{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class Lxe{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}}var QH=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},UT=function(s,e){return function(t,i){e(t,i,s)}},$I;(function(s){s.OUTLINE_MODEL="outlineModel",s.FOLDING_PROVIDER_MODEL="foldingProviderModel",s.INDENTATION_MODEL="indentationModel"})($I||($I={}));var bm;(function(s){s[s.VALID=0]="VALID",s[s.INVALID=1]="INVALID",s[s.CANCELED=2]="CANCELED"})(bm||(bm={}));let xQ=class extends re{constructor(e,t,i,n){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Ac(300)),this._updateOperation=this._register(new me),this._editor.getOption(116).defaultModel){case $I.OUTLINE_MODEL:this._modelProviders.push(new kQ(this._editor,n));case $I.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new DQ(this._editor,t,n));case $I.INDENTATION_MODEL:this._modelProviders.push(new LQ(this._editor,i));break}}dispose(){this._modelProviders.forEach(e=>e.dispose()),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const t of this._modelProviders){const{statusPromise:i,modelPromise:n}=t.computeStickyModel(e);this._modelPromise=n;const r=await i;if(this._modelPromise!==n)return null;switch(r){case bm.CANCELED:return this._updateOperation.clear(),null;case bm.VALID:return t.stickyModel}}return null}).catch(t=>(Nt(t),null))}};xQ=QH([UT(2,ht),UT(3,nt)],xQ);class Dxe extends re{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,bm.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=Xs(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?bm.CANCELED:(this._stickyModel=this.createStickyModel(e,i),bm.VALID):this._invalid()).then(void 0,i=>(Nt(i),bm.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let kQ=class extends Dxe{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return Jf.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){var o;const{stickyOutlineElement:i,providerID:n}=this._stickyModelFromOutlineModel(t,(o=this._stickyModel)==null?void 0:o.outlineProviderId),r=this._editor.getModel();return new Lxe(r.uri,r.getVersionId(),i,n)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(hi.first(e.children.values())instanceof GSe){const a=hi.find(e.children.values(),l=>l.id===t);if(a)i=a.children;else{let l="",d=-1,h;for(const[f,p]of e.children.entries()){const m=this._findSumOfRangesOfGroup(p);m>d&&(h=p,d=m,l=p.id)}t=l,i=h.children}}else i=e.children;const n=[],r=Array.from(i.values()).sort((a,l)=>{const d=new HI(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),h=new HI(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(d,h)});for(const a of r)n.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new tB(void 0,n,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const r of e.children.values())if(r.symbol.selectionRange.startLineNumber!==r.symbol.range.endLineNumber)if(r.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(r,r.symbol.selectionRange.startLineNumber));else for(const o of r.children.values())i.push(this._stickyModelFromOutlineElement(o,r.symbol.selectionRange.startLineNumber));i.sort((r,o)=>this._comparator(r.range,o.range));const n=new HI(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new tB(n,i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof gX?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};kQ=QH([UT(1,nt)],kQ);class Ixe extends Dxe{constructor(e){super(e),this._foldingLimitReporter=new USe(e)}createStickyModel(e,t){const i=this._fromFoldingRegions(t),n=this._editor.getModel();return new Lxe(n.uri,n.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],n=new tB(void 0,[],void 0);for(let r=0;r<t;r++){const o=e.getParentIndex(r);let a;o!==-1?a=i[o]:a=n;const l=new tB(new HI(e.getStartLineNumber(r),e.getEndLineNumber(r)+1),[],a);a.children.push(l),i.push(l)}return n}}let LQ=class extends Ixe{constructor(e,t){super(e),this._languageConfigurationService=t,this.provider=this._register(new Mne(e.getModel(),this._languageConfigurationService,this._foldingLimitReporter))}async createModelFromProvider(e){return this.provider.compute(e)}};LQ=QH([UT(1,Vn)],LQ);let DQ=class extends Ixe{constructor(e,t,i){super(e),this._languageFeaturesService=i;const n=b_.getFoldingRangeProviders(this._languageFeaturesService,e.getModel());n.length>0&&(this.provider=this._register(new Rne(e.getModel(),n,t,this._foldingLimitReporter,void 0)))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){var t;return((t=this.provider)==null?void 0:t.compute(e))??null}};DQ=QH([UT(2,nt)],DQ);var zut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},vpe=function(s,e){return function(t,i){e(t,i,s)}};class jut{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}let IQ=class extends re{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new se),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new me),this._updateSoon=this._register(new Ui(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(116)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(116).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this.updateStickyModelProvider(),this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this._sessionStore.add(ut(()=>{var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){var e;return(e=this._model)==null?void 0:e.version}updateStickyModelProvider(){var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null;const e=this._editor;e.hasModel()&&(this._stickyModelProvider=new xQ(e,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){var e;(e=this._cts)==null||e.dispose(!0),this._cts=new Bn,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=await this._stickyModelProvider.update(e);e.isCancellationRequested||(this._model=t)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,n,r){if(t.children.length===0)return;let o=r;const a=[];for(let h=0;h<t.children.length;h++){const f=t.children[h];f.range&&a.push(f.range.startLineNumber)}const l=this.updateIndex(_E(a,e.startLineNumber,(h,f)=>h-f)),d=this.updateIndex(_E(a,e.startLineNumber+n,(h,f)=>h-f));for(let h=l;h<=d;h++){const f=t.children[h];if(!f)return;if(f.range){const p=f.range.startLineNumber,m=f.range.endLineNumber;e.startLineNumber<=m+1&&p-1<=e.endLineNumber&&p!==o&&(o=p,i.push(new jut(p,m-1,n+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,f,i,n+1,p))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,f,i,n,r)}}getCandidateStickyLinesIntersecting(e){var n,r;if(!((n=this._model)!=null&&n.element))return[];let t=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,t,0,-1);const i=(r=this._editor._getViewModel())==null?void 0:r.getHiddenAreas();if(i)for(const o of i)t=t.filter(a=>!(a.startLineNumber>=o.startLineNumber&&a.endLineNumber<=o.endLineNumber+1));return t}};IQ=zut([vpe(1,nt),vpe(2,Vn)],IQ);var Uut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},V1=function(s,e){return function(t,i){e(t,i,s)}},EQ,FC;let jg=(FC=class extends re{constructor(e,t,i,n,r,o,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=n,this._contextKeyService=a,this._sessionStore=new me,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._stickyScrollWidget=new Vut(this._editor),this._stickyLineCandidateProvider=new IQ(this._editor,i,r),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=VI.Empty,this._onDidResize(),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(h=>{this._readConfigurationChange(h)})),this._register(ue(l,Ae.CONTEXT_MENU,async h=>{this._onContextMenu(_t(l),h)})),this._stickyScrollFocusedContextKey=U.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=U.stickyScrollVisible.bindTo(this._contextKeyService);const d=this._register(Ou(l));this._register(d.onDidBlur(h=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(d.onDidFocus(h=>{this.focus()})),this._registerMouseListeners(),this._register(ue(l,Ae.MOUSE_DOWN,h=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(EQ.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)==null||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new me,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex<this._stickyScrollWidget.lineNumberCount-1&&this._focusNav(!0)}focusPrevious(){this._focusedStickyElementIndex>0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(W.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new me),t=this._register(new HH(this._editor,{extractLineNumberFromMouseEvent:r=>{const o=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);return o?o.lineNumber:0}})),i=r=>{if(!this._editor.hasModel()||r.target.type!==12||r.target.detail!==this._stickyScrollWidget.getId())return null;const o=r.target.element;if(!o||o.innerText!==o.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(o);return a?{range:new W(a.lineNumber,a.column,a.lineNumber,a.column+o.innerText.length),textElement:o}:null},n=this._stickyScrollWidget.getDomNode();this._register($n(n,Ae.CLICK,r=>{if(r.ctrlKey||r.altKey||r.metaKey||!r.leftButton)return;if(r.shiftKey){const d=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(d===null)return;const h=new ie(this._endLineNumbers[d],1);this._revealLineInCenterIfOutsideViewport(h);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(r.target)){const d=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);this._toggleFoldingRegionForLine(d);return}if(!this._stickyScrollWidget.isInStickyLine(r.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(r.target);if(!l){const d=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);if(d===null)return;l=new ie(d,1)}this._revealPosition(l)})),this._register($n(n,Ae.MOUSE_MOVE,r=>{if(r.shiftKey){const o=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(o===null||this._showEndForLine!==null&&this._showEndForLine===o)return;this._showEndForLine=o,this._renderStickyScroll();return}this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(ue(n,Ae.MOUSE_LEAVE,r=>{this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([r,o])=>{const a=i(r);if(!a||!r.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:d}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(d.style.textDecoration==="underline")return;const h=new Bn;e.add(ut(()=>h.dispose(!0)));let f;KN(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new ie(l.startLineNumber,l.startColumn+1),!1,h.token).then(p=>{if(!h.token.isCancellationRequested)if(p.length!==0){this._candidateDefinitionsLength=p.length;const m=d;f!==m?(e.clear(),f=m,f.style.textDecoration="underline",e.add(ut(()=>{f.style.textDecoration="none"}))):f||(f=m,f.style.textDecoration="underline",e.add(ut(()=>{f.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async r=>{if(r.target.type!==12||r.target.detail!==this._stickyScrollWidget.getId())return;const o=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);o&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:o.lineNumber,column:1})),this._instaService.invokeFunction(ISe,r,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new yd(e,t);this._contextMenuService.showContextMenu({menuId:rt.StickyScrollContext,getAnchor:()=>i})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t==null?void 0:t.foldingIcon;if(!i)return;Ene(this._foldingModel,Number.MAX_VALUE,[e]),i.isCollapsed=!i.isCollapsed;const n=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(67)*t.index+1;this._editor.setScrollTop(n),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(116);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(i=>{i.scrollTopChanged&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(i=>this._onTokensChange(i))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=void 0,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(68).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=void 0,this._renderStickyScroll(0)}))}_readConfigurationChange(e){(e.hasChanged(116)||e.hasChanged(73)||e.hasChanged(67)||e.hasChanged(111)||e.hasChanged(68))&&this._readConfiguration(),e.hasChanged(68)&&this._renderStickyScroll(0)}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const n of e.ranges)if(i>=n.fromLineNumber&&i<=n.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(0)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(67);this._maxStickyLines=Math.round(t*.25)}async _renderStickyScroll(e){const t=this._editor.getModel();if(!t||t.isTooLargeForTokenization()){this._resetState();return}const i=this._updateAndGetMinRebuildFromLine(e),n=this._stickyLineCandidateProvider.getVersionId();if(n===void 0||n===t.getVersionId())if(!this._focused)await this._updateState(i);else if(this._focusedStickyElementIndex===-1)await this._updateState(i),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const o=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(i),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(o)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}_updateAndGetMinRebuildFromLine(e){if(e!==void 0){const t=this._minRebuildFromLine!==void 0?this._minRebuildFromLine:1/0;this._minRebuildFromLine=Math.min(e,t)}return this._minRebuildFromLine}async _updateState(e){var i;this._minRebuildFromLine=void 0,this._foldingModel=await((i=b_.get(this._editor))==null?void 0:i.getFoldingModel())??void 0,this._widgetState=this.findScrollWidgetState();const t=this._widgetState.startLineNumbers.length>0;this._stickyScrollVisibleContextKey.set(t),this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}async _resetState(){this._minRebuildFromLine=void 0,this._foldingModel=void 0,this._widgetState=VI.Empty,this._stickyScrollVisibleContextKey.set(!1),this._stickyScrollWidget.setState(void 0,void 0)}findScrollWidgetState(){const e=this._editor.getOption(67),t=Math.min(this._maxStickyLines,this._editor.getOption(116).maxLineCount),i=this._editor.getScrollTop();let n=0;const r=[],o=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new HI(a[0].startLineNumber,a[a.length-1].endLineNumber),d=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const h of d){const f=h.startLineNumber,p=h.endLineNumber,m=h.nestingDepth;if(p-f>0){const v=(m-1)*e,b=m*e,y=this._editor.getBottomForLineNumber(f)-i,x=this._editor.getTopForLineNumber(p)-i,D=this._editor.getBottomForLineNumber(p)-i;if(v>x&&v<=D){r.push(f),o.push(p+1),n=D-b;break}else b>y&&b<=D&&(r.push(f),o.push(p+1));if(r.length===t)break}}}return this._endLineNumbers=o,new VI(r,o,n,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},EQ=FC,FC.ID="store.contrib.stickyScrollController",FC);jg=EQ=Uut([V1(1,gl),V1(2,nt),V1(3,ht),V1(4,Vn),V1(5,sc),V1(6,wt)],jg);class qut extends ta{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...Lt("toggleEditorStickyScroll","Toggle Editor Sticky Scroll"),mnemonicTitle:w({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Editor Sticky Scroll")},metadata:{description:Lt("toggleEditorStickyScroll.description","Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:But.View,toggled:{condition:ve.equals("config.editor.stickyScroll.enabled",!0),title:w("stickyScroll","Sticky Scroll"),mnemonicTitle:w({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:rt.CommandPalette},{id:rt.MenubarAppearanceMenu,group:"4_editor",order:3},{id:rt.StickyScrollContext}]})}async run(e){const t=e.get(Gt),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}}const JH=100;class Kut extends Uu{constructor(){super({id:"editor.action.focusStickyScroll",title:{...Lt("focusStickyScroll","Focus on the editor sticky scroll"),mnemonicTitle:w({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll")},precondition:ve.and(ve.has("config.editor.stickyScroll.enabled"),U.stickyScrollVisible),menu:[{id:rt.CommandPalette}]})}runEditorCommand(e,t){var i;(i=jg.get(t))==null||i.focus()}}class Gut extends Uu{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:Lt("selectNextStickyScrollLine.title","Select the next editor sticky scroll line"),precondition:U.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:JH,primary:18}})}runEditorCommand(e,t){var i;(i=jg.get(t))==null||i.focusNext()}}class Yut extends Uu{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:Lt("selectPreviousStickyScrollLine.title","Select the previous sticky scroll line"),precondition:U.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:JH,primary:16}})}runEditorCommand(e,t){var i;(i=jg.get(t))==null||i.focusPrevious()}}class Zut extends Uu{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:Lt("goToFocusedStickyScrollLine.title","Go to the focused sticky scroll line"),precondition:U.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:JH,primary:3}})}runEditorCommand(e,t){var i;(i=jg.get(t))==null||i.goToFocused()}}class Xut extends Uu{constructor(){super({id:"editor.action.selectEditor",title:Lt("selectEditor.title","Select Editor"),precondition:U.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:JH,primary:9}})}runEditorCommand(e,t){var i;(i=jg.get(t))==null||i.selectEditor()}}pi(jg.ID,jg,1);on(qut);on(Kut);on(Yut);on(Gut);on(Zut);on(Xut);var Exe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},JD=function(s,e){return function(t,i){e(t,i,s)}};class Qut{constructor(e,t,i,n,r,o){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=r,this.completion=o}}let TQ=class extends D5e{constructor(e,t,i,n,r,o){super(r.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=o}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn<i.endColumn&&this.completionModel.getIncompleteProvider().size===0}get items(){const e=[],{items:t}=this.completionModel,i=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},t),n=hi.slice(t,i),r=hi.slice(t,0,i);let o=5;for(const a of hi.concat(n,r)){if(a.score===Nu.Default)continue;const l=new W(a.editStart.lineNumber,a.editStart.column,a.editInsertEnd.lineNumber,a.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),d=a.completion.insertTextRules&&a.completion.insertTextRules&4?{snippet:a.completion.insertText}:a.completion.insertText;e.push(new Qut(l,d,a.filterTextLow??a.labelLow,a.completion.additionalTextEdits,a.completion.command,a)),o-->=0&&a.resolve(zt.None)}return e}};TQ=Exe([JD(5,GH)],TQ);let NQ=class extends re{constructor(e,t,i,n){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=n,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,n){var m;if(i.selectedSuggestionInfo)return;let r;for(const v of this._editorService.listCodeEditors())if(v.getModel()===e){r=v;break}if(!r)return;const o=r.getOption(90);if(w0.isAllOff(o))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(w0.valueFor(o,l)!=="inline")return;let d=e.getWordAtPosition(t),h;if(d!=null&&d.word||(h=this._getTriggerCharacterInfo(e,t)),!(d!=null&&d.word)&&!h||(d||(d=e.getWordUntilPosition(t)),d.endColumn!==t.column))return;let f;const p=e.getValueInRange(new W(t.lineNumber,1,t.lineNumber,t.column));if(!h&&((m=this._lastResult)!=null&&m.canBeReused(e,t.lineNumber,d))){const v=new npe(p,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=v,this._lastResult.acquire(),f=this._lastResult}else{const v=await Pne(this._languageFeatureService.completionProvider,e,t,new AT(void 0,V3.createSuggestFilter(r).itemKind,h==null?void 0:h.providers),h&&{triggerKind:1,triggerCharacter:h.ch},n);let b;v.needsClipboard&&(b=await this._clipboardService.readText());const y=new tm(v.items,t.column,new npe(p,0),W3.None,r.getOption(119),r.getOption(113),{boostFullMatch:!1,firstMatchCanBeWeak:!1},b);f=new TQ(e,t.lineNumber,d,y,v,this._suggestMemoryService)}return this._lastResult=f,f}handleItemDidShow(e,t){t.completion.resolve(zt.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var r;const i=e.getValueInRange(W.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),n=new Set;for(const o of this._languageFeatureService.completionProvider.all(e))(r=o.triggerCharacters)!=null&&r.includes(i)&&n.add(o);if(n.size!==0)return{providers:n,ch:i}}};NQ=Exe([JD(0,nt),JD(1,Xg),JD(2,GH),JD(3,wi)],NQ);Ux(NQ);class Jut extends Xe{constructor(){super({id:"editor.action.forceRetokenize",label:w("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const n=new ur;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}Pe(Jut);const RW=class RW extends ta{constructor(){super({id:RW.ID,title:Lt({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:Lt("tabMovesFocusDescriptions","Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const t=!XS.getTabFocusMode();XS.setTabFocusMode(t),Jo(t?w("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):w("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}};RW.ID="editor.action.toggleTabFocusMode";let MQ=RW;on(MQ);var eht=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},bpe=function(s,e){return function(t,i){e(t,i,s)}};let RQ=class extends re{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,i={},n,r){super(),this._link=t,this._hoverService=n,this._enabled=!0,this.el=Ie(e,Fe("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??ia("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const o=this._register(new ri(this.el,"click")),a=this._register(new ri(this.el,"keypress")),l=We.chain(a.event,f=>f.map(p=>new rn(p)).filter(p=>p.keyCode===3)),d=this._register(new ri(this.el,an.Tap)).event;this._register(so.addTarget(this.el));const h=We.any(o.event,l,d);this._register(h(f=>{this.enabled&&(li.stop(f,!0),i!=null&&i.opener?i.opener(this._link.href):r.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){this.hoverDelegate.showNativeHover?this.el.title=e??"":!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};RQ=eht([bpe(3,uf),bpe(4,Ta)],RQ);var Txe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Nxe=function(s,e){return function(t,i){e(t,i,s)}};const tht=26;let PQ=class extends re{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(OQ))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{var t;this.hide(),(t=e.onClose)==null||t.call(e)}}),this._editor.setBanner(this.banner.element,tht)}};PQ=Txe([Nxe(1,ht)],PQ);let OQ=class extends re{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(Bg,{}),this.element=Fe("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=Fe("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){kr(this.element)}show(e){kr(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=Ie(this.element,Fe("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(Fe(`div${Ct.asCSSSelector(e.icon)}`));const n=Ie(this.element,Fe("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=Ie(this.element,Fe("div.message-actions-container")),e.actions)for(const o of e.actions)this._register(this.instantiationService.createInstance(RQ,this.messageActionsContainer,{...o,tabIndex:-1},{}));const r=Ie(this.element,Fe("div.action-container"));this.actionBar=this._register(new Zl(r)),this.actionBar.push(this._register(new rl("banner.close","Close Banner",Ct.asClassName(Jwe),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};OQ=Txe([Nxe(0,ht)],OQ);var Gne=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},fS=function(s,e){return function(t,i){e(t,i,s)}};const iht=vn("extensions-warning-message",Oe.warning,w("warningIcon","Icon shown with a warning message in the extensions editor."));var xS;let qT=(xS=class extends re{constructor(e,t,i,n){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=r=>{if(r&&r.hasMore){if(this._bannerClosed)return;const o=Math.max(r.ambiguousCharacterCount,r.nonBasicAsciiCharacterCount,r.invisibleCharacterCount);let a;if(r.nonBasicAsciiCharacterCount>=o)a={message:w("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new GT};else if(r.ambiguousCharacterCount>=o)a={message:w("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new yy};else if(r.invisibleCharacterCount>=o)a={message:w("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new KT};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:iht,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(PQ,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(126),this._register(i.onDidChangeTrust(r=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(r=>{r.hasChanged(126)&&(this._options=e.getOption(126),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=nht(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?new Intl.NumberFormat().resolvedOptions().locale:i==="_vscode"?k4e:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new AQ(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new sht(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},xS.ID="editor.contrib.unicodeHighlighter",xS);qT=Gne([fS(1,Na),fS(2,pye),fS(3,ht)],qT);function nht(s,e){return{nonBasicASCII:e.nonBasicASCII===Nl?!s:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Nl?!s:e.includeComments,includeStrings:e.includeStrings===Nl?!s:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let AQ=class extends re{constructor(e,t,i,n){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Ui(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const n of t.ranges)i.push({range:n,options:iB.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!Aie(t,e))return null;const i=t.getValueInRange(e.range);return{reason:Rxe(i,this._options),inComment:Fie(t,e),inString:Bie(t,e)}}};AQ=Gne([fS(3,Na)],AQ);class sht extends re{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Ui(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const n of e){const r=Yee.computeUnicodeHighlights(this._model,this._options,n);for(const o of r.ranges)i.ranges.push(o);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||r.hasMore}if(!i.hasMore)for(const n of i.ranges)t.push({range:n,options:iB.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return Aie(t,e)?{reason:Rxe(i,this._options),inComment:Fie(t,e),inString:Bie(t,e)}:null}}const Mxe=w("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options");let FQ=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=this._editor.getContribution(qT.ID);if(!n)return[];const r=[],o=new Set;let a=300;for(const l of t){const d=n.getDecorationInfo(l);if(!d)continue;const f=i.getValueInRange(l.range).codePointAt(0),p=Aj(f);let m;switch(d.reason.kind){case 0:{pN(d.reason.confusableWith)?m=w("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",p,Aj(d.reason.confusableWith.codePointAt(0))):m=w("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",p,Aj(d.reason.confusableWith.codePointAt(0)));break}case 1:m=w("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",p);break;case 2:m=w("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",p);break}if(o.has(m))continue;o.add(m);const v={codePoint:f,reason:d.reason,inComment:d.inComment,inString:d.inString},b=w("unicodeHighlight.adjustSettings","Adjust settings"),y=`command:${nB.ID}?${encodeURIComponent(JSON.stringify(v))}`,x=new io("",!0).appendMarkdown(m).appendText(" ").appendLink(y,b,Mxe);r.push(new bd(this,l.range,[x],!1,a++))}return r}renderHoverParts(e,t){return Rst(e,t,this._editor,this._languageService,this._openerService)}};FQ=Gne([fS(1,Rn),fS(2,Ta)],FQ);function BQ(s){return`U+${s.toString(16).padStart(4,"0")}`}function Aj(s){let e=`\`${BQ(s)}\``;return Mb.isInvisibleCharacter(s)||(e+=` "${`${rht(s)}`}"`),e}function rht(s){return s===96?"`` ` ``":"`"+String.fromCodePoint(s)+"`"}function Rxe(s,e){return Yee.computeUnicodeHighlightReason(s,e)}const PW=class PW{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let n=this.map.get(i);return n||(n=At.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}};PW.instance=new PW;let iB=PW;class oht extends Xe{constructor(){super({id:yy.ID,label:w("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}async run(e,t,i){const n=e==null?void 0:e.get(Gt);n&&this.runAction(n)}async runAction(e){await e.updateValue(ga.includeComments,!1,2)}}class aht extends Xe{constructor(){super({id:yy.ID,label:w("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}async run(e,t,i){const n=e==null?void 0:e.get(Gt);n&&this.runAction(n)}async runAction(e){await e.updateValue(ga.includeStrings,!1,2)}}const OW=class OW extends Xe{constructor(){super({id:OW.ID,label:w("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}async run(e,t,i){const n=e==null?void 0:e.get(Gt);n&&this.runAction(n)}async runAction(e){await e.updateValue(ga.ambiguousCharacters,!1,2)}};OW.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let yy=OW;const AW=class AW extends Xe{constructor(){super({id:AW.ID,label:w("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}async run(e,t,i){const n=e==null?void 0:e.get(Gt);n&&this.runAction(n)}async runAction(e){await e.updateValue(ga.invisibleCharacters,!1,2)}};AW.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let KT=AW;const FW=class FW extends Xe{constructor(){super({id:FW.ID,label:w("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}async run(e,t,i){const n=e==null?void 0:e.get(Gt);n&&this.runAction(n)}async runAction(e){await e.updateValue(ga.nonBasicASCII,!1,2)}};FW.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let GT=FW;const BW=class BW extends Xe{constructor(){super({id:BW.ID,label:w("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){const{codePoint:n,reason:r,inString:o,inComment:a}=i,l=String.fromCodePoint(n),d=e.get(Uc),h=e.get(Gt);function f(v){return Mb.isInvisibleCharacter(v)?w("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",BQ(v)):w("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${BQ(v)} "${l}"`)}const p=[];if(r.kind===0)for(const v of r.notAmbiguousInLocales)p.push({label:w("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',v),run:async()=>{cht(h,[v])}});if(p.push({label:f(n),run:()=>lht(h,[n])}),a){const v=new oht;p.push({label:v.label,run:async()=>v.runAction(h)})}else if(o){const v=new aht;p.push({label:v.label,run:async()=>v.runAction(h)})}if(r.kind===0){const v=new yy;p.push({label:v.label,run:async()=>v.runAction(h)})}else if(r.kind===1){const v=new KT;p.push({label:v.label,run:async()=>v.runAction(h)})}else if(r.kind===2){const v=new GT;p.push({label:v.label,run:async()=>v.runAction(h)})}else dht(r);const m=await d.pick(p,{title:Mxe});m&&await m.run()}};BW.ID="editor.action.unicodeHighlight.showExcludeOptions";let nB=BW;async function lht(s,e){const t=s.getValue(ga.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await s.updateValue(ga.allowedCharacters,i,2)}async function cht(s,e){var n;const t=(n=s.inspect(ga.allowedLocales).user)==null?void 0:n.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const r of e)i[r]=!0;await s.updateValue(ga.allowedLocales,i,2)}function dht(s){throw new Error(`Unexpected value: ${s}`)}Pe(yy);Pe(KT);Pe(GT);Pe(nB);pi(qT.ID,qT,1);qy.register(FQ);var uht=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Cpe=function(s,e){return function(t,i){e(t,i,s)}};const Pxe="ignoreUnusualLineTerminators";function hht(s,e,t){s.setModelProperty(e.uri,Pxe,t)}function fht(s,e){return s.getModelProperty(e.uri,Pxe)}var kS;let sB=(kS=class extends re{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(127),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(127)&&(this._config=this._editor.getOption(127),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(n=>{n.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||fht(this._codeEditorService,e)===!0||this._editor.getOption(92))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:w("unusualLineTerminators.title","Unusual Line Terminators"),message:w("unusualLineTerminators.message","Detected unusual line terminators"),detail:w("unusualLineTerminators.detail","The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",Wc(e.uri)),primaryButton:w({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:w("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){hht(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},kS.ID="editor.contrib.unusualLineTerminatorsDetector",kS);sB=uht([Cpe(1,CN),Cpe(2,wi)],sB);pi(sB.ID,sB,1);var ght=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},pht=function(s,e){return function(t,i){e(t,i,s)}};class ype{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,i){const n=[],r=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return r?e.isDisposed()?void 0:e.findMatches(r.word,!0,!1,!0,d4,!1).map(a=>({range:a.range,kind:TS.Text})):Promise.resolve(n)}provideMultiDocumentHighlights(e,t,i,n){const r=new dr,o=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!o)return Promise.resolve(r);for(const a of[e,...i]){if(a.isDisposed())continue;const d=a.findMatches(o.word,!0,!1,!0,d4,!1).map(h=>({range:h.range,kind:TS.Text}));d&&r.set(a.uri,d)}return r}}let WQ=class extends re{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new ype)),this._register(e.multiDocumentHighlightProvider.register("*",new ype))}};WQ=ght([pht(0,nt)],WQ);var Oxe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},PF=function(s,e){return function(t,i){e(t,i,s)}},us,VQ;const Yne=new qe("hasWordHighlights",!1);function Axe(s,e,t,i){const n=s.ordered(e);return Oee(n.map(r=>()=>Promise.resolve(r.provideDocumentHighlights(e,t,i)).then(void 0,ns)),r=>r!=null).then(r=>{if(r){const o=new dr;return o.set(e.uri,r),o}return new dr})}function mht(s,e,t,i,n,r){const o=s.ordered(e);return Oee(o.map(a=>()=>{const l=r.filter(d=>tCe(d)).filter(d=>ste(a.selector,d.uri,d.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,l,n)).then(void 0,ns)}),a=>a!=null)}class Fxe{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=Xs(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new W(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const n=t.startLineNumber,r=t.startColumn,o=t.endColumn,a=this._getCurrentWordRange(e,t);let l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let d=0,h=i.length;!l&&d<h;d++){const f=i.getRange(d);f&&f.startLineNumber===n&&f.startColumn<=r&&f.endColumn>=o&&(l=!0)}return l}cancel(){this.result.cancel()}}class _ht extends Fxe{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return Axe(this._providers,e,t.getPosition(),n).then(r=>r||new dr)}}class vht extends Fxe{constructor(e,t,i,n,r){super(e,t,i),this._providers=n,this._otherModels=r}_compute(e,t,i,n){return mht(this._providers,e,t.getPosition(),i,n,this._otherModels).then(r=>r||new dr)}}function bht(s,e,t,i,n){return new _ht(e,t,n,s)}function Cht(s,e,t,i,n,r){return new vht(e,t,n,s,r)}Ea("_executeDocumentHighlights",async(s,e,t)=>{const i=s.get(nt),n=await Axe(i.documentHighlightProvider,e,t,zt.None);return n==null?void 0:n.get(e.uri)});var Ym;let HQ=(Ym=class{constructor(e,t,i,n,r){this.toUnhook=new me,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new dr,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.runDelayer=this.toUnhook.add(new Ac(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=r,this._hasWordHighlights=Yne.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(81),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(o=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this.runDelayer.trigger(()=>{this._onPositionChanged(o)})})),this.toUnhook.add(e.onDidFocusEditorText(o=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}))})),this.toUnhook.add(e.onDidChangeModelContent(o=>{wV(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(o=>{!o.newModelUrl&&o.oldModelUrl?this._stopSingular():us.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(o=>{var l,d;const a=this.editor.getOption(81);if(this.occurrencesHighlight!==a)switch(this.occurrencesHighlight=a,a){case"off":this._stopAll();break;case"singleFile":this._stopAll((d=(l=us.query)==null?void 0:l.modelInfo)==null?void 0:d.model);break;case"multiFile":us.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",a);break}})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,us.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&(this.runDelayer.cancel(),this._run())}_getSortedHighlights(){return this.decorations.getRanges().sort(W.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(r=>r.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const r=this._getWord();if(r){const o=this.editor.getModel().getLineContent(n.startLineNumber);Jo(`${o}, ${i+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(r=>r.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const r=this._getWord();if(r){const o=this.editor.getModel().getLineContent(n.startLineNumber);Jo(`${o}, ${i+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=us.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),us.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),i=[];for(const n of t){if(!n.hasModel()||qE(n.getModel().uri,e==null?void 0:e.uri))continue;const r=us.storedDecorationIDs.get(n.getModel().uri);if(!r)continue;n.removeDecorations(r),i.push(n.getModel().uri);const o=y_.get(n);o!=null&&o.wordHighlighter&&o.wordHighlighter.decorations.length>0&&(o.wordHighlighter.decorations.clear(),o.wordHighlighter.workerRequest=null,o.wordHighlighter._hasWordHighlights.set(!1))}for(const n of i)us.storedDecorationIDs.delete(n)}_stopSingular(){var e,t,i,n;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())==null?void 0:e.uri.scheme)!==Rt.vscodeNotebookCell&&((i=(t=us.query)==null?void 0:t.modelInfo)==null?void 0:i.model.uri.scheme)!==Rt.vscodeNotebookCell?(us.query=null,this._run()):(n=us.query)!=null&&n.modelInfo&&(us.query.modelInfo=null)),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(e){this._removeAllDecorations(e),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){var t;if(this.occurrencesHighlight==="off"){this._stopAll();return}if(e.reason!==3&&((t=this.editor.getModel())==null?void 0:t.uri.scheme)!==Rt.vscodeNotebookCell){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===Rt.vscodeNotebookCell){const r=[],o=this.codeEditorService.listCodeEditors();for(const a of o){const l=a.getModel();l&&l!==e&&l.uri.scheme===Rt.vscodeNotebookCell&&r.push(l)}return r}const i=[],n=this.codeEditorService.listCodeEditors();for(const r of n){if(!tne(r))continue;const o=r.getModel();o&&e===o.modified&&i.push(o.modified)}if(i.length)return i;if(this.occurrencesHighlight==="singleFile")return[];for(const r of n){const o=r.getModel();o&&o!==e&&i.push(o)}return i}_run(e){var n,r;let t;if(this.editor.hasTextFocus()){const o=this.editor.getSelection();if(!o||o.startLineNumber!==o.endLineNumber){us.query=null,this._stopAll();return}const a=o.startColumn,l=o.endColumn,d=this._getWord();if(!d||d.startColumn>a||d.endColumn<l){us.query=null,this._stopAll();return}t=this.workerRequest&&this.workerRequest.isValid(this.model,o,this.decorations),us.query={modelInfo:{model:this.model,selection:o},word:d}}else if(!us.query){this._stopAll();return}if(this.lastCursorPositionChangeTime=new Date().getTime(),t)this.workerRequestCompleted&&this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else if(qE(this.editor.getModel().uri,(n=us.query.modelInfo)==null?void 0:n.model.uri)){if(!e){const l=this.decorations.getRanges();for(const d of l)if(d.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model:void 0);const o=++this.workerRequestTokenId;this.workerRequestCompleted=!1;const a=this.getOtherModelsToHighlight(this.editor.getModel());if(!us.query||!us.query.modelInfo||us.query.modelInfo.model.isDisposed())return;this.workerRequest=this.computeWithModel(us.query.modelInfo.model,us.query.modelInfo.selection,us.query.word,a),(r=this.workerRequest)==null||r.result.then(l=>{o===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=l||[],this._beginRenderDecorations())},Nt)}}computeWithModel(e,t,i,n){return n.length?Cht(this.multiDocumentProviders,e,t,i,this.editor.getOption(132),n):bht(this.providers,e,t,i,this.editor.getOption(132))}_beginRenderDecorations(){const e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){var t,i,n;this.renderDecorationsTimer=-1;const e=this.codeEditorService.listCodeEditors();for(const r of e){const o=y_.get(r);if(!o)continue;const a=[],l=(t=r.getModel())==null?void 0:t.uri;if(l&&this.workerRequestValue.has(l)){const d=us.storedDecorationIDs.get(l),h=this.workerRequestValue.get(l);if(h)for(const p of h)p.range&&a.push({range:p.range,options:ldt(p.kind)});let f=[];r.changeDecorations(p=>{f=p.deltaDecorations(d??[],a)}),us.storedDecorationIDs=us.storedDecorationIDs.set(l,f),a.length>0&&((i=o.wordHighlighter)==null||i.decorations.set(a),(n=o.wordHighlighter)==null||n._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}},us=Ym,Ym.storedDecorationIDs=new dr,Ym.query=null,Ym);HQ=us=Oxe([PF(4,wi)],HQ);var BC;let y_=(BC=class extends re{static get(e){return e.getContribution(VQ.ID)}constructor(e,t,i,n){super(),this._wordHighlighter=null;const r=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new HQ(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,n))};this._register(e.onDidChangeModel(o=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),r()})),r()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)==null||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)==null||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},VQ=BC,BC.ID="editor.contrib.wordHighlighter",BC);y_=VQ=Oxe([PF(1,wt),PF(2,nt),PF(3,wi)],y_);class Bxe extends Xe{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=y_.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class yht extends Bxe{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:w("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:Yne,kbOpts:{kbExpr:U.editorTextFocus,primary:65,weight:100}})}}class wht extends Bxe{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:w("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:Yne,kbOpts:{kbExpr:U.editorTextFocus,primary:1089,weight:100}})}}class Sht extends Xe{constructor(){super({id:"editor.action.wordHighlight.trigger",label:w("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=y_.get(t);n&&n.restoreViewState(!0)}}pi(y_.ID,y_,0);Pe(yht);Pe(wht);Pe(Sht);Ux(WQ);class e7 extends zs{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=Bc(t.getOption(132),t.getOption(131)),r=t.getModel(),o=t.getSelections(),a=o.length>1,l=o.map(d=>{const h=new ie(d.positionLineNumber,d.positionColumn),f=this._move(n,r,h,this._wordNavigationType,a);return this._moveTo(d,f,this._inSelectionMode)});if(r.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,l.map(d=>Ci.fromModelSelection(d))),l.length===1){const d=new ie(l[0].positionLineNumber,l[0].positionColumn);t.revealPosition(d,0)}}_moveTo(e,t,i){return i?new lt(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new lt(t.lineNumber,t.column,t.lineNumber,t.column)}}class R_ extends e7{_move(e,t,i,n,r){return Ni.moveWordLeft(e,t,i,n,r)}}class P_ extends e7{_move(e,t,i,n,r){return Ni.moveWordRight(e,t,i,n)}}class xht extends R_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class kht extends R_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class Lht extends R_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:ve.and(U.textInputFocus,(e=ve.and(xN,gH))==null?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class Dht extends R_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class Iht extends R_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class Eht extends R_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:ve.and(U.textInputFocus,(e=ve.and(xN,gH))==null?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class Tht extends R_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n,r){return super._move(Bc(ju.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class Nht extends R_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n,r){return super._move(Bc(ju.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class Mht extends P_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class Rht extends P_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:ve.and(U.textInputFocus,(e=ve.and(xN,gH))==null?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class Pht extends P_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class Oht extends P_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class Aht extends P_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:ve.and(U.textInputFocus,(e=ve.and(xN,gH))==null?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class Fht extends P_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class Bht extends P_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n,r){return super._move(Bc(ju.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class Wht extends P_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n,r){return super._move(Bc(ju.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class t7 extends zs{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e.get(Vn);if(!t.hasModel())return;const r=Bc(t.getOption(132),t.getOption(131)),o=t.getModel(),a=t.getSelections(),l=t.getOption(6),d=t.getOption(11),h=n.getLanguageConfiguration(o.getLanguageId()).getAutoClosingPairs(),f=t._getViewModel(),p=a.map(m=>{const v=this._delete({wordSeparators:r,model:o,selection:m,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:d,autoClosingPairs:h,autoClosedCharacters:f.getCursorAutoClosedCharacters()},this._wordNavigationType);return new zr(v,"")});t.pushUndoStop(),t.executeCommands(this.id,p),t.pushUndoStop()}}class Zne extends t7{_delete(e,t){const i=Ni.deleteWordLeft(e,t);return i||new W(1,1,1,1)}}class Xne extends t7{_delete(e,t){const i=Ni.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),r=e.model.getLineMaxColumn(n);return new W(n,r,n,r)}}class Vht extends Zne{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:U.writable})}}class Hht extends Zne{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:U.writable})}}class $ht extends Zne{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class zht extends Xne{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:U.writable})}}class jht extends Xne{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:U.writable})}}class Uht extends Xne{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class qht extends Xe{constructor(){super({id:"deleteInsideWord",precondition:U.writable,label:w("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const n=Bc(t.getOption(132),t.getOption(131)),r=t.getModel(),a=t.getSelections().map(l=>{const d=Ni.deleteInsideWord(n,r,l);return new zr(d,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}Ue(new xht);Ue(new kht);Ue(new Lht);Ue(new Dht);Ue(new Iht);Ue(new Eht);Ue(new Mht);Ue(new Rht);Ue(new Pht);Ue(new Oht);Ue(new Aht);Ue(new Fht);Ue(new Tht);Ue(new Nht);Ue(new Bht);Ue(new Wht);Ue(new Vht);Ue(new Hht);Ue(new $ht);Ue(new zht);Ue(new jht);Ue(new Uht);Pe(qht);class Kht extends t7{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=kH.deleteWordPartLeft(e);return i||new W(1,1,1,1)}}class Ght extends t7{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=kH.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),r=e.model.getLineMaxColumn(n);return new W(n,r,n,r)}}class Wxe extends e7{_move(e,t,i,n,r){return kH.moveWordPartLeft(e,t,i,r)}}class Yht extends Wxe{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}fi.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class Zht extends Wxe{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}fi.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class Vxe extends e7{_move(e,t,i,n,r){return kH.moveWordPartRight(e,t,i)}}class Xht extends Vxe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class Qht extends Vxe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}Ue(new Kht);Ue(new Ght);Ue(new Yht);Ue(new Zht);Ue(new Xht);Ue(new Qht);const rse=class rse extends re{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=al.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(93);t||(this.editor.isSimpleWidget?t=new io(w("editor.simple.readonly","Cannot edit in read-only input")):t=new io(w("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};rse.ID="editor.contrib.readOnlyMessageController";let rB=rse;pi(rB.ID,rB,2);var Jht=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},wpe=function(s,e){return function(t,i){e(t,i,s)}};let $Q=class extends re{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=Kt(this,void 0);const n=$r("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),r=$r("_textModel.onDidChangeContent",We.debounce(o=>this._textModel.onDidChangeContent(o),()=>{},100));this._register(wa(async(o,a)=>{n.read(o),r.read(o);const l=a.add(new WQe),d=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(d,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter(r=>e.contains(r.range.startLineNumber)&&!e.contains(r.range.endLineNumber));return n.sort(bve(Ko(r=>r.range.endLineNumber-r.range.startLineNumber,kd))),n.map(r=>({name:r.name,kind:r.kind,startLineNumber:r.range.startLineNumber}))}};$Q=Jht([wpe(1,nt),wpe(2,ZN)],$Q);n3.setBreadcrumbsSourceFactory((s,e)=>e.createInstance($Q,s));const ose=class ose extends re{constructor(e){super(),this.editor=e,this.widget=null,Ru&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(92);!this.widget&&e?this.widget=new zQ(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};ose.ID="editor.contrib.iPadShowKeyboard";let oB=ose;const WW=class WW extends re{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(ue(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(ue(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return WW.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}};WW.ID="editor.contrib.ShowKeyboardWidget";let zQ=WW;pi(oB.ID,oB,3);var eft=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Spe=function(s,e){return function(t,i){e(t,i,s)}},jQ,WC;let YT=(WC=class extends re{static get(e){return e.getContribution(jQ.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(n=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(n=>this.stop())),this._register(qn.onDidChange(n=>this.stop())),this._register(this._editor.onKeyUp(n=>n.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new UQ(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}},jQ=WC,WC.ID="editor.contrib.inspectTokens",WC);YT=jQ=eft([Spe(1,ac),Spe(2,Rn)],YT);class tft extends Xe{constructor(){super({id:"editor.action.inspectTokens",label:QK.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=YT.get(t);i==null||i.launch()}}function ift(s){let e="";for(let t=0,i=s.length;t<i;t++){const n=s.charCodeAt(t);switch(n){case 9:e+="→";break;case 32:e+="·";break;default:e+=String.fromCharCode(n)}}return e}function nft(s,e){const t=qn.get(e);if(t)return t;const i=s.encodeLanguageId(e);return{getInitialState:()=>$S,tokenize:(n,r,o)=>Dte(e,o),tokenizeEncoded:(n,r,o)=>sH(i,o)}}const VW=class VW extends re{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=nft(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return VW._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let l=t.tokens1.length-1;l>=0;l--){const d=t.tokens1[l];if(e.column-1>=d.offset){i=l;break}}let n=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){n=l;break}const r=this._model.getLineContent(e.lineNumber);let o="";if(i<t.tokens1.length){const l=t.tokens1[i].offset,d=i+1<t.tokens1.length?t.tokens1[i+1].offset:r.length;o=r.substring(l,d)}Lr(this._domNode,Fe("h2.tm-token",void 0,ift(o),Fe("span.tm-token-length",void 0,`${o.length} ${o.length===1?"char":"chars"}`))),Ie(this._domNode,Fe("hr.tokens-inspect-separator",{style:"clear:both"}));const a=(n<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(n<<1)+1]):null;Ie(this._domNode,Fe("table.tm-metadata-table",void 0,Fe("tbody",void 0,Fe("tr",void 0,Fe("td.tm-metadata-key",void 0,"language"),Fe("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),Fe("tr",void 0,Fe("td.tm-metadata-key",void 0,"token type"),Fe("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),Fe("tr",void 0,Fe("td.tm-metadata-key",void 0,"font style"),Fe("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),Fe("tr",void 0,Fe("td.tm-metadata-key",void 0,"foreground"),Fe("td.tm-metadata-value",void 0,`${a?be.Format.CSS.formatHex(a.foreground):"-?-"}`)),Fe("tr",void 0,Fe("td.tm-metadata-key",void 0,"background"),Fe("td.tm-metadata-value",void 0,`${a?be.Format.CSS.formatHex(a.background):"-?-"}`))))),Ie(this._domNode,Fe("hr.tokens-inspect-separator")),i<t.tokens1.length&&Ie(this._domNode,Fe("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=qn.getColorMap(),i=ma.getLanguageId(e),n=ma.getTokenType(e),r=ma.getFontStyle(e),o=ma.getForeground(e),a=ma.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:n,fontStyle:r,foreground:t[o],background:t[a]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),e&8&&(t+="strikethrough "),t.length===0&&(t="---"),t}_getTokensAtLine(e){const t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),n=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:i.tokens,tokens2:n.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}};VW._ID="editor.contrib.inspectTokensWidget";let UQ=VW;pi(YT.ID,YT,4);Pe(tft);var sft=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},xpe=function(s,e){return function(t,i){e(t,i,s)}},eI,VC;let qQ=(VC=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=Wn.as(Wy.Quickaccess)}provide(e){const t=new me;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const n=this.registry.getQuickAccessProvider(i.substr(eI.PREFIX.length));n&&n.prefix&&n.prefix!==eI.PREFIX&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==eI.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,n=i||"…";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:w("helpPickAriaLabel","{0}, {1}",n,t.description),description:t.description}})}},eI=VC,VC.PREFIX="?",VC);qQ=eI=sft([xpe(0,Uc),xpe(1,Ri)],qQ);Wn.as(Wy.Quickaccess).registerQuickAccessProvider({ctor:qQ,prefix:"",helpEntries:[{description:JK.helpQuickAccessActionLabel}]});class Hxe{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){var o;const n=new me;e.canAcceptInBackground=!!((o=this.options)!=null&&o.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const r=n.add(new er);return r.value=this.doProvide(e,t,i),n.add(this.onDidActiveTextEditorControlChange(()=>{r.value=void 0,r.value=this.doProvide(e,t)})),n}doProvide(e,t,i){const n=new me,r=this.activeTextEditorControl;if(r&&this.canProvideWithTextEditor(r)){const o={editor:r},a=Y1e(r);if(a){let l=r.saveViewState()??void 0;n.add(a.onDidChangeCursorPosition(()=>{l=r.saveViewState()??void 0})),o.restoreViewState=()=>{l&&r===this.activeTextEditorControl&&r.restoreViewState(l)},n.add(t_(t.onCancellationRequested)(()=>{var d;return(d=o.restoreViewState)==null?void 0:d.call(o)}))}n.add(ut(()=>this.clearDecorations(r))),n.add(this.provideWithTextEditor(o,e,t,i))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&ef(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return tne(e)?(t=e.getModel())==null?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const n=[];this.rangeHighlightDecorationId&&(n.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),n.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const r=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:Kn(Vye),position:Gl.Full}}}],[o,a]=i.deltaDecorations(n,r);this.rangeHighlightDecorationId={rangeHighlightId:o,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const HW=class HW extends Hxe{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=w("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,re.None}provideWithTextEditor(e,t,i){const n=e.editor,r=new me;r.add(t.onDidAccept(l=>{const[d]=t.selectedItems;if(d){if(!this.isValidLineNumber(n,d.lineNumber))return;this.gotoLocation(e,{range:this.toRange(d.lineNumber,d.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const o=()=>{const l=this.parsePosition(n,t.value.trim().substr(HW.PREFIX.length)),d=this.getPickLabel(n,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:d}],t.ariaLabel=d,!this.isValidLineNumber(n,l.lineNumber)){this.clearDecorations(n);return}const h=this.toRange(l.lineNumber,l.column);n.revealRangeInCenter(h,0),this.addDecorations(n,h)};o(),r.add(t.onDidChangeValue(()=>o()));const a=Y1e(n);return a&&a.getOptions().get(68).renderType===2&&(a.updateOptions({lineNumbers:"on"}),r.add(ut(()=>a.updateOptions({lineNumbers:"relative"})))),r}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(r=>parseInt(r,10)).filter(r=>!isNaN(r)),n=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:n+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?w("gotoLineColumnLabel","Go to line {0} and character {1}.",t,i):w("gotoLineLabel","Go to line {0}.",t);const n=e.getPosition()||{lineNumber:1,column:1},r=this.lineCount(e);return r>1?w("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",n.lineNumber,n.column,r):w("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",n.lineNumber,n.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||typeof i!="number")return!1;const n=this.getModel(e);if(!n)return!1;const r={lineNumber:t,column:i};return n.validatePosition(r).equals(r)}lineCount(e){var t;return((t=this.getModel(e))==null?void 0:t.getLineCount())??0}};HW.PREFIX=":";let KQ=HW;var rft=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},oft=function(s,e){return function(t,i){e(t,i,s)}};let ZT=class extends KQ{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=We.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};ZT=rft([oft(0,wi)],ZT);var HC;let $xe=(HC=class extends Xe{constructor(){super({id:HC.ID,label:Q4.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:U.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Uc).quickAccess.show(ZT.PREFIX)}},HC.ID="editor.action.gotoLine",HC);Pe($xe);Wn.as(Wy.Quickaccess).registerQuickAccessProvider({ctor:ZT,prefix:ZT.PREFIX,helpEntries:[{description:Q4.gotoLineActionLabel,commandId:$xe.ID}]});const zxe=[void 0,[]];function Fj(s,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?aft(s,n.values,t,i):jxe(s,e,t,i)}function aft(s,e,t,i){let n=0;const r=[];for(const o of e){const[a,l]=jxe(s,o,t,i);if(typeof a!="number")return zxe;n+=a,r.push(...l)}return[n,lft(r)]}function jxe(s,e,t,i){const n=ny(e.original,e.originalLowercase,t,s,s.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?[n[0],SN(n)]:zxe}function lft(s){const e=s.sort((n,r)=>n.start-r.start),t=[];let i;for(const n of e)!i||!cft(i,n)?(i=n,t.push(n)):(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end));return t}function cft(s,e){return!(s.end<e.start||e.end<s.start)}function kpe(s){return s.startsWith('"')&&s.endsWith('"')}const Uxe=" ";function GQ(s){typeof s!="string"&&(s="");const e=s.toLowerCase(),{pathNormalized:t,normalized:i,normalizedLowercase:n}=Lpe(s),r=t.indexOf(Lu)>=0,o=kpe(s);let a;const l=s.split(Uxe);if(l.length>1)for(const d of l){const h=kpe(d),{pathNormalized:f,normalized:p,normalizedLowercase:m}=Lpe(d);p&&(a||(a=[]),a.push({original:d,originalLowercase:d.toLowerCase(),pathNormalized:f,normalized:p,normalizedLowercase:m,expectContiguousMatch:h}))}return{original:s,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:n,values:a,containsPathSeparator:r,expectContiguousMatch:o}}function Lpe(s){let e;Kr?e=s.replace(/\//g,Lu):e=s.replace(/\\/g,Lu);const t=C3e(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function Dpe(s){return Array.isArray(s)?GQ(s.map(e=>e.original).join(Uxe)):GQ(s.original)}var dft=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Ipe=function(s,e){return function(t,i){e(t,i,s)}},OF,vu;let Ub=(vu=class extends Hxe{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,w("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),re.None}provideWithTextEditor(e,t,i,n){const r=e.editor,o=this.getModel(r);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,t,i,n):this.doProvideWithoutEditorSymbols(e,o,t,i):re.None}doProvideWithoutEditorSymbols(e,t,i,n){const r=new me;return this.provideLabelPick(i,w("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,r)||n.isCancellationRequested||r.add(this.doProvideWithEditorSymbols(e,t,i,n)))(),r}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new Ix,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))}));return t.add(ut(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,n,r){var f;const o=e.editor,a=new me;a.add(i.onDidAccept(p=>{var v;const[m]=i.selectedItems;m&&m.range&&(this.gotoLocation(e,{range:m.range.selection,keyMods:i.keyMods,preserveFocus:p.inBackground}),(v=r==null?void 0:r.handleAccept)==null||v.call(r,m),p.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:p})=>{p&&p.range&&(this.gotoLocation(e,{range:p.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const l=this.getDocumentSymbols(t,n);let d;const h=async p=>{d==null||d.dispose(!0),i.busy=!1,d=new Bn(n),i.busy=!0;try{const m=GQ(i.value.substr(OF.PREFIX.length).trim()),v=await this.doGetSymbolPicks(l,m,void 0,d.token,t);if(n.isCancellationRequested)return;if(v.length>0){if(i.items=v,p&&m.original.length===0){const b=ME(v,y=>!!(y.type!=="separator"&&y.range&&W.containsPosition(y.range.decoration,p)));b&&(i.activeItems=[b])}}else m.original.length>0?this.provideLabelPick(i,w("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(i,w("noSymbolResults","No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>h(void 0))),h((f=o.getSelection())==null?void 0:f.getPosition()),a.add(i.onDidChangeActive(()=>{const[p]=i.activeItems;p&&p.range&&(o.revealRangeInCenter(p.range.selection,0),this.addDecorations(o,p.range.decoration))})),a}async doGetSymbolPicks(e,t,i,n,r){var y,x;const o=await e;if(n.isCancellationRequested)return[];const a=t.original.indexOf(OF.SCOPE_PREFIX)===0,l=a?1:0;let d,h;t.values&&t.values.length>1?(d=Dpe(t.values[0]),h=Dpe(t.values.slice(1))):d=t;let f;const p=(x=(y=this.options)==null?void 0:y.openSideBySideDirection)==null?void 0:x.call(y);p&&(f=[{iconClass:p==="right"?Ct.asClassName(Oe.splitHorizontal):Ct.asClassName(Oe.splitVertical),tooltip:p==="right"?w("openToSide","Open to the Side"):w("openToBottom","Open to the Bottom")}]);const m=[];for(let D=0;D<o.length;D++){const S=o[D],I=v3e(S.name),E=`$(${m4.toIcon(S.kind).id}) ${I}`,R=E.length-I.length;let M=S.containerName;i!=null&&i.extraContainerLabel&&(M?M=`${i.extraContainerLabel} • ${M}`:M=i.extraContainerLabel);let O,V,te,J;if(t.original.length>l){let H=!1;if(d!==t&&([O,V]=Fj(E,{...t,values:void 0},l,R),typeof O=="number"&&(H=!0)),typeof O!="number"&&([O,V]=Fj(E,d,l,R),typeof O!="number"))continue;if(!H&&h){if(M&&h.original.length>0&&([te,J]=Fj(M,h)),typeof te!="number")continue;typeof O=="number"&&(O+=te)}}const z=S.tags&&S.tags.indexOf(1)>=0;m.push({index:D,kind:S.kind,score:O,label:E,ariaLabel:u3e(S.name,S.kind),description:M,highlights:z?void 0:{label:V,description:J},range:{selection:W.collapseToStart(S.selectionRange),decoration:S.range},uri:r.uri,symbolName:I,strikethrough:z,buttons:f})}const v=m.sort((D,S)=>a?this.compareByKindAndScore(D,S):this.compareByScore(D,S));let b=[];if(a){let E=function(){S&&typeof D=="number"&&I>0&&(S.label=YC(Wj[D]||Bj,I))},D,S,I=0;for(const R of v)D!==R.kind?(E(),D=R.kind,I=1,S={type:"separator"},b.push(S)):I++,b.push(R);E()}else v.length>0&&(b=[{label:w("symbols","symbols ({0})",m.length),type:"separator"},...v]);return b}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const i=Wj[e.kind]||Bj,n=Wj[t.kind]||Bj,r=i.localeCompare(n);return r===0?this.compareByScore(e,t):r}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},OF=vu,vu.PREFIX="@",vu.SCOPE_PREFIX=":",vu.PREFIX_BY_CATEGORY=`${vu.PREFIX}${vu.SCOPE_PREFIX}`,vu);Ub=OF=dft([Ipe(0,nt),Ipe(1,ZN)],Ub);const Bj=w("property","properties ({0})"),Wj={5:w("method","methods ({0})"),11:w("function","functions ({0})"),8:w("_constructor","constructors ({0})"),12:w("variable","variables ({0})"),4:w("class","classes ({0})"),22:w("struct","structs ({0})"),23:w("event","events ({0})"),24:w("operator","operators ({0})"),10:w("interface","interfaces ({0})"),2:w("namespace","namespaces ({0})"),3:w("package","packages ({0})"),25:w("typeParameter","type parameters ({0})"),1:w("modules","modules ({0})"),6:w("property","properties ({0})"),9:w("enum","enumerations ({0})"),21:w("enumMember","enumeration members ({0})"),14:w("string","strings ({0})"),0:w("file","files ({0})"),17:w("array","arrays ({0})"),15:w("number","numbers ({0})"),16:w("boolean","booleans ({0})"),18:w("object","objects ({0})"),19:w("key","keys ({0})"),7:w("field","fields ({0})"),13:w("constant","constants ({0})")};var uft=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Vj=function(s,e){return function(t,i){e(t,i,s)}};let YQ=class extends Ub{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=We.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};YQ=uft([Vj(0,wi),Vj(1,nt),Vj(2,ZN)],YQ);const $W=class $W extends Xe{constructor(){super({id:$W.ID,label:GE.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:U.hasDocumentSymbolProvider,kbOpts:{kbExpr:U.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Uc).quickAccess.show(Ub.PREFIX,{itemActivation:cu.NONE})}};$W.ID="editor.action.quickOutline";let aB=$W;Pe(aB);Wn.as(Wy.Quickaccess).registerQuickAccessProvider({ctor:YQ,prefix:Ub.PREFIX,helpEntries:[{description:GE.quickOutlineActionLabel,prefix:Ub.PREFIX,commandId:aB.ID},{description:GE.quickOutlineByCategoryActionLabel,prefix:Ub.PREFIX_BY_CATEGORY}]});function hft(s){const e=new Map;for(const t of s)e.set(t,(e.get(t)??0)+1);return e}class zI{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,r=[];for(const[o,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const d=this.computeSimilarityScore(l,i,n);d>0&&r.push({key:o,score:d})}}return r}static termFrequencies(e){return hft(zI.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(i);const n=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(n.length>1)for(const r of n)r.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(r)&&(yield t(r))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const n of t.textChunks){const r=zI.termFrequencies(n);for(const o of r.keys())this.chunkOccurrences.set(o,(this.chunkOccurrences.get(o)??0)+1);i.push({text:n,tf:r})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const n of i.tf.keys()){const r=this.chunkOccurrences.get(n);if(typeof r=="number"){const o=r-1;o<=0?this.chunkOccurrences.delete(n):this.chunkOccurrences.set(n,o)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[r,o]of Object.entries(t)){const a=e.tf.get(r);if(!a)continue;let l=i.get(r);typeof l!="number"&&(l=this.computeIdf(r),i.set(r,l));const d=a*l;n+=d*o}return n}computeEmbedding(e){const t=zI.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const r=this.computeIdf(i);r>0&&(t[i]=n*r)}return t}}function fft(s){var i;const e=s.slice(0);e.sort((n,r)=>r.score-n.score);const t=((i=e[0])==null?void 0:i.score)??0;if(t>0)for(const n of e)n.score/=t;return e}var x0;(function(s){s[s.NO_ACTION=0]="NO_ACTION",s[s.CLOSE_PICKER=1]="CLOSE_PICKER",s[s.REFRESH_PICKER=2]="REFRESH_PICKER",s[s.REMOVE_ITEM=3]="REMOVE_ITEM"})(x0||(x0={}));function Hj(s){const e=s;return Array.isArray(e.items)}function Epe(s){const e=s;return!!e.picks&&e.additionalPicks instanceof Promise}class gft extends re{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var d;const n=new me;e.canAcceptInBackground=!!((d=this.options)!=null&&d.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let r;const o=n.add(new er),a=async()=>{var y;const h=o.value=new me;r==null||r.dispose(!0),e.busy=!1,r=new Bn(t);const f=r.token;let p=e.value.substring(this.prefix.length);(y=this.options)!=null&&y.shouldSkipTrimPickFilter||(p=p.trim());const m=this._getPicks(p,h,f,i),v=(x,D)=>{var E;let S,I;if(Hj(x)?(S=x.items,I=x.active):S=x,S.length===0){if(D)return!1;(p.length>0||e.hideInput)&&((E=this.options)!=null&&E.noResultsPick)&&(bE(this.options.noResultsPick)?S=[this.options.noResultsPick(p)]:S=[this.options.noResultsPick])}return e.items=S,I&&(e.activeItems=[I]),!0},b=async x=>{let D=!1,S=!1;await Promise.all([(async()=>{typeof x.mergeDelay=="number"&&(await Og(x.mergeDelay),f.isCancellationRequested)||S||(D=v(x.picks,!0))})(),(async()=>{e.busy=!0;try{const I=await x.additionalPicks;if(f.isCancellationRequested)return;let E,R;Hj(x.picks)?(E=x.picks.items,R=x.picks.active):E=x.picks;let M,O;if(Hj(I)?(M=I.items,O=I.active):M=I,M.length>0||!D){let V;if(!R&&!O){const te=e.activeItems[0];te&&E.indexOf(te)!==-1&&(V=te)}v({items:[...E,...M],active:R||O||V})}}finally{f.isCancellationRequested||(e.busy=!1),S=!0}})()])};if(m!==null)if(Epe(m))await b(m);else if(!(m instanceof Promise))v(m);else{e.busy=!0;try{const x=await m;if(f.isCancellationRequested)return;Epe(x)?await b(x):v(x)}finally{f.isCancellationRequested||(e.busy=!1)}}};n.add(e.onDidChangeValue(()=>a())),a(),n.add(e.onDidAccept(h=>{var p;if(i!=null&&i.handleAccept){h.inBackground||e.hide(),(p=i.handleAccept)==null||p.call(i,e.activeItems[0]);return}const[f]=e.selectedItems;typeof(f==null?void 0:f.accept)=="function"&&(h.inBackground||e.hide(),f.accept(e.keyMods,h))}));const l=async(h,f)=>{var m;if(typeof f.trigger!="function")return;const p=((m=f.buttons)==null?void 0:m.indexOf(h))??-1;if(p>=0){const v=f.trigger(p,e.keyMods),b=typeof v=="number"?v:await v;if(t.isCancellationRequested)return;switch(b){case x0.NO_ACTION:break;case x0.CLOSE_PICKER:e.hide();break;case x0.REFRESH_PICKER:a();break;case x0.REMOVE_ITEM:{const y=e.items.indexOf(f);if(y!==-1){const x=e.items.slice(),D=x.splice(y,1),S=e.activeItems.filter(E=>E!==D[0]),I=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=x,S&&(e.activeItems=S),e.keepScrollPosition=I}break}}}};return n.add(e.onDidTriggerItemButton(({button:h,item:f})=>l(h,f))),n.add(e.onDidTriggerSeparatorButton(({button:h,separator:f})=>l(h,f))),n}}var qxe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},im=function(s,e){return function(t,i){e(t,i,s)}},Xv,Rs,Vh;let ZQ=(Vh=class extends gft{constructor(e,t,i,n,r,o){super(Xv.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=n,this.telemetryService=r,this.dialogService=o,this.commandsHistory=this._register(this.instantiationService.createInstance(XQ)),this.options=e}async _getPicks(e,t,i,n){var m,v;const r=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const o=t_(()=>{const b=new zI;b.updateDocuments(r.map(x=>({key:x.commandId,textChunks:[this.getTfIdfChunk(x)]})));const y=b.calculateScores(e,i);return fft(y).filter(x=>x.score>Xv.TFIDF_THRESHOLD).slice(0,Xv.TFIDF_MAX_RESULTS)}),a=[];for(const b of r){const y=Xv.WORD_FILTER(e,b.label)??void 0,x=b.commandAlias?Xv.WORD_FILTER(e,b.commandAlias)??void 0:void 0;if(y||x)b.highlights={label:y,detail:this.options.showAlias?x:void 0},a.push(b);else if(e===b.commandId)a.push(b);else if(e.length>=3){const D=o();if(i.isCancellationRequested)return[];const S=D.find(I=>I.key===b.commandId);S&&(b.tfIdfScore=S.score,a.push(b))}}const l=new Map;for(const b of a){const y=l.get(b.label);y?(b.description=b.commandId,y.description=y.commandId):l.set(b.label,b)}a.sort((b,y)=>{if(b.tfIdfScore&&y.tfIdfScore)return b.tfIdfScore===y.tfIdfScore?b.label.localeCompare(y.label):y.tfIdfScore-b.tfIdfScore;if(b.tfIdfScore)return 1;if(y.tfIdfScore)return-1;const x=this.commandsHistory.peek(b.commandId),D=this.commandsHistory.peek(y.commandId);if(x&&D)return x>D?-1:1;if(x)return-1;if(D)return 1;if(this.options.suggestedCommandIds){const S=this.options.suggestedCommandIds.has(b.commandId),I=this.options.suggestedCommandIds.has(y.commandId);if(S&&I)return 0;if(S)return-1;if(I)return 1}return b.label.localeCompare(y.label)});const d=[];let h=!1,f=!0,p=!!this.options.suggestedCommandIds;for(let b=0;b<a.length;b++){const y=a[b];b===0&&this.commandsHistory.peek(y.commandId)&&(d.push({type:"separator",label:w("recentlyUsed","recently used")}),h=!0),f&&y.tfIdfScore!==void 0&&(d.push({type:"separator",label:w("suggested","similar commands")}),f=!1),p&&y.tfIdfScore===void 0&&!this.commandsHistory.peek(y.commandId)&&((m=this.options.suggestedCommandIds)!=null&&m.has(y.commandId))&&(d.push({type:"separator",label:w("commonlyUsed","commonly used")}),h=!0,p=!1),h&&y.tfIdfScore===void 0&&!this.commandsHistory.peek(y.commandId)&&!((v=this.options.suggestedCommandIds)!=null&&v.has(y.commandId))&&(d.push({type:"separator",label:w("morecCommands","other commands")}),h=!1),d.push(this.toCommandPick(y,n))}return this.hasAdditionalCommandPicks(e,i)?{picks:d,additionalPicks:(async()=>{var x;const b=await this.getAdditionalCommandPicks(r,a,e,i);if(i.isCancellationRequested)return[];const y=b.map(D=>this.toCommandPick(D,n));return f&&((x=y[0])==null?void 0:x.type)!=="separator"&&y.unshift({type:"separator",label:w("suggested","similar commands")}),y})()}:d}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?w("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:n,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{var r;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(t==null?void 0:t.from)??"quick open"});try{(r=e.args)!=null&&r.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(o){zc(o)||this.dialogService.error(w("canNotRun","Command '{0}' resulted in an error",e.label),f3(o))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let n=e;return t&&t!==e&&(n+=` - ${t}`),i&&i.value!==e&&(n+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),n}},Xv=Vh,Vh.PREFIX=">",Vh.TFIDF_THRESHOLD=.5,Vh.TFIDF_MAX_RESULTS=5,Vh.WORD_FILTER=vte(jE,T8e,JCe),Vh);ZQ=Xv=qxe([im(1,ht),im(2,Ri),im(3,ln),im(4,oo),im(5,CN)],ZQ);var bu;let XQ=(bu=class extends re{constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===QE.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Rs.getConfiguredCommandHistoryLength(this.configurationService),Rs.cache&&Rs.cache.limit!==this.configuredCommandsHistoryLength&&(Rs.cache.limit=this.configuredCommandsHistoryLength,Rs.hasChanges=!0))}load(){const e=this.storageService.get(Rs.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(n){this.logService.error(`[CommandsHistory] invalid data: ${n}`)}const i=Rs.cache=new cf(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((r,o)=>r.value-o.value),n.forEach(r=>i.set(r.key,r.value))}Rs.counter=this.storageService.getNumber(Rs.PREF_KEY_COUNTER,0,Rs.counter)}push(e){Rs.cache&&(Rs.cache.set(e,Rs.counter++),Rs.hasChanges=!0)}peek(e){var t;return(t=Rs.cache)==null?void 0:t.peek(e)}saveState(){if(!Rs.cache||!Rs.hasChanges)return;const e={usesLRU:!0,entries:[]};Rs.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(Rs.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(Rs.PREF_KEY_COUNTER,Rs.counter,0,0),Rs.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var n,r;const i=(r=(n=e.getValue().workbench)==null?void 0:n.commandPalette)==null?void 0:r.history;return typeof i=="number"?i:Rs.DEFAULT_COMMANDS_HISTORY_LENGTH}},Rs=bu,bu.DEFAULT_COMMANDS_HISTORY_LENGTH=50,bu.PREF_KEY_CACHE="commandPalette.mru.cache",bu.PREF_KEY_COUNTER="commandPalette.mru.counter",bu.counter=1,bu.hasChanges=!1,bu);XQ=Rs=qxe([im(0,Wd),im(1,Gt),im(2,Gr)],XQ);class pft extends ZQ{constructor(e,t,i,n,r,o){super(e,t,i,n,r,o)}getCodeEditorCommandPicks(){var i;const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const n of e.getSupportedActions()){let r;(i=n.metadata)!=null&&i.description&&(Ize(n.metadata.description)?r=n.metadata.description:r={original:n.metadata.description,value:n.metadata.description}),t.push({commandId:n.id,commandAlias:n.alias,commandDescription:r,label:xte(n.label)||n.id})}return t}}var mft=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},H1=function(s,e){return function(t,i){e(t,i,s)}};let XT=class extends pft{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,i,n,r,o){super({showAlias:!1},e,i,n,r,o),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};XT=mft([H1(0,ht),H1(1,wi),H1(2,Ri),H1(3,ln),H1(4,oo),H1(5,CN)],XT);const zW=class zW extends Xe{constructor(){super({id:zW.ID,label:J4.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:U.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Uc).quickAccess.show(XT.PREFIX)}};zW.ID="editor.action.quickCommand";let lB=zW;Pe(lB);Wn.as(Wy.Quickaccess).registerQuickAccessProvider({ctor:XT,prefix:XT.PREFIX,helpEntries:[{description:J4.quickCommandHelp,commandId:lB.ID}]});var _ft=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},$1=function(s,e){return function(t,i){e(t,i,s)}};let QQ=class extends _y{constructor(e,t,i,n,r,o,a){super(!0,e,t,i,n,r,o,a)}};QQ=_ft([$1(1,wt),$1(2,wi),$1(3,ps),$1(4,ht),$1(5,Wd),$1(6,Gt)],QQ);pi(_y.ID,QQ,4);class vft extends Xe{constructor(){super({id:"editor.action.toggleHighContrast",label:tG.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(ac),n=i.getColorTheme();Eu(n.type)?(i.setTheme(this._originalThemeName||(OS(n.type)?nS:ng)),this._originalThemeName=null):(i.setTheme(OS(n.type)?Wb:Vb),this._originalThemeName=n.themeName)}}Pe(vft);const bft={name:"Files",components:{FileTreeNode:e4e,CopyPathDialog:r4e},data(){return{browseResult:{current_path:"",parent_path:null,items:[]},selectedPath:"",selectedItem:null,fileContent:null,loading:!1,expandedPaths:new Set,openFiles:[],activeFile:null,fileLoading:!1,saving:!1,editor:null,originalContent:"",sidebarWidth:260,isResizing:!1,contextMenu:{visible:!1,x:0,y:0,target:null},inputDialog:{visible:!1,title:"",value:"",placeholder:"",type:"",target:null},fileIcons:{js:"fa-brands fa-js text-yellow-400",ts:"fa-brands fa-js text-blue-400",html:"fa-brands fa-html5 text-orange-500",css:"fa-brands fa-css3 text-blue-400",scss:"fa-brands fa-sass text-pink-400",json:"fa-solid fa-file-code text-yellow-300",yaml:"fa-solid fa-file-code text-blue-300",yml:"fa-solid fa-file-code text-blue-300",md:"fa-solid fa-file-lines text-gray-400",py:"fa-brands fa-python text-blue-500",vue:"fa-brands fa-vuejs text-green-400",sh:"fa-solid fa-terminal text-green-400",go:"fa-brands fa-golang text-cyan-400",rs:"fa-brands fa-rust text-orange-400"},uploadProgress:{visible:!1,percent:0,filename:"",cancelled:!1},downloadProgress:{visible:!1,percent:0,filename:"",cancelled:!1}}},computed:{fileTreeData(){return this.browseResult.items.map(e=>this.transformNode(e)).sort((e,t)=>e.is_directory===t.is_directory?e.name.localeCompare(t.name):e.is_directory?-1:1)},hasChanges(){return this.editor?this.editor.getValue()!==this.originalContent:!1},isBinaryFile(){var s;return(s=this.activeFile)==null?void 0:s.is_binary}},watch:{activeFile:{immediate:!0,handler(s){this.$nextTick(()=>{!this.editor&&this.$refs.editorContainer&&this.initEditor(),s&&this.editor?this.loadFileContent(s.path).then(e=>{const t=this.getLanguageFromFilename(s.name),i=$b.createModel(e,t);this.editor.setModel(i),this.originalContent=e}):this.editor&&(this.editor.setModel($b.createModel("","plaintext")),this.originalContent="")})}}},async created(){await this.browse(""),document.addEventListener("click",this.hideContextMenu),document.addEventListener("mousemove",this.handleResize),document.addEventListener("mouseup",this.stopResize)},activated(){!this.editor&&this.$refs.editorContainer&&this.initEditor()},beforeDestroy(){document.removeEventListener("click",this.hideContextMenu),document.removeEventListener("mousemove",this.handleResize),document.removeEventListener("mouseup",this.stopResize),this.editor&&(this.editor.dispose(),this.editor=null)},methods:{async browse(s){this.loading=!0;try{const e=await Yt.browseFilesystem(s);this.browseResult=e.data}catch(e){console.error("Browse failed:",e)}finally{this.loading=!1}},transformNode(s){return{name:s.name,path:s.path,is_directory:s.is_directory,is_drive:s.is_drive||!1,size:s.size,has_children:s.is_directory,expanded:!1,children:[]}},handleSelect(s){this.selectedPath=s.path,this.selectedItem=s},async openFile(s){var t;if(s.is_directory)return;const e=this.openFiles.find(i=>i.path===s.path);if(e){this.activeFile=e;return}this.fileLoading=!0;try{const i=await this.loadFileContent(s.path),n={name:s.name,path:s.path,is_binary:((t=this.fileContent)==null?void 0:t.is_binary)||!1};this.openFiles.push(n),this.activeFile=n}catch(i){console.error("Open file failed:",i)}finally{this.fileLoading=!1}},closeFile(s){var t;const e=this.openFiles.findIndex(i=>i.path===s.path);if(this.openFiles=this.openFiles.filter(i=>i.path!==s.path),((t=this.activeFile)==null?void 0:t.path)===s.path){const i=e>0?e-1:0;this.activeFile=this.openFiles.length>0?this.openFiles[Math.min(i,this.openFiles.length-1)]:null}},async saveFile(){if(!(!this.activeFile||!this.hasChanges)){this.saving=!0;try{const s=this.editor.getValue();await Yt.writeFile(this.activeFile.path,s),this.originalContent=s,this.$message.success("文件已保存")}catch(s){console.error("Save file failed:",s),this.$message.error("保存文件失败")}finally{this.saving=!1}}},async handleLoadChildren({path:s,callback:e}){try{const n=((await Yt.browseFilesystem(s)).data.items||[]).map(r=>this.transformNode(r)).sort((r,o)=>r.is_directory===o.is_directory?r.name.localeCompare(o.name):r.is_directory?-1:1);e(n)}catch(t){console.error("Load children failed:",t),e([])}},goUp(){this.browseResult.parent_path!==null&&this.browse(this.browseResult.parent_path===""?"":this.browseResult.parent_path)},goHome(){this.browse("")},refresh(){this.browse(this.browseResult.current_path||"")},async loadFileContent(s){var e;try{const t=await Yt.getFileContent(s);return this.fileContent=t.data||{content:"加载失败",is_binary:!1,size:0},((e=t.data)==null?void 0:e.content)||""}catch(t){return console.error("Load file content failed:",t),this.fileContent={content:"加载失败",is_binary:!1,size:0},""}},startResize(s){this.isResizing=!0,document.body.style.cursor="col-resize",document.body.style.userSelect="none"},handleResize(s){if(!this.isResizing)return;const e=s.clientX;e>=150&&e<=500&&(this.sidebarWidth=e)},stopResize(){this.isResizing=!1,document.body.style.cursor="",document.body.style.userSelect=""},showContextMenu(s,e){e&&(s.preventDefault(),this.contextMenu={visible:!0,x:s.pageX,y:s.pageY,target:e},this.selectedItem=e,this.selectedPath=e.path)},hideContextMenu(){this.contextMenu.visible=!1},async createNewFile(){this.hideContextMenu(),this.inputDialog={visible:!0,title:"新建文件",value:"",placeholder:"输入文件名",type:"file",target:this.contextMenu.target},this.$nextTick(()=>{var s;(s=this.$refs.renameInput)==null||s.focus()})},async createNewFolder(){this.hideContextMenu(),this.inputDialog={visible:!0,title:"新建文件夹",value:"",placeholder:"输入文件夹名",type:"folder",target:this.contextMenu.target},this.$nextTick(()=>{var s;(s=this.$refs.renameInput)==null||s.focus()})},copyPath(){this.hideContextMenu(),this.$refs.copyPathDialog.open(this.contextMenu.target.path)},renameItem(){this.hideContextMenu(),this.inputDialog={visible:!0,title:"重命名",value:this.contextMenu.target.name,placeholder:"输入新名称",type:"rename",target:this.contextMenu.target},this.$nextTick(()=>{var s,e;(s=this.$refs.renameInput)==null||s.focus(),(e=this.$refs.renameInput)==null||e.select()})},async confirmInput(){const{type:s,value:e,target:t}=this.inputDialog;if(!e.trim()){this.cancelInput();return}try{const i=t.path.includes("\\")?"\\":"/";if(s==="file"){const n=t.path+i+e.trim();await Yt.writeFile(n,"")}else if(s==="folder"){const n=t.path+i+e.trim();await Yt.createDirectory(n)}else if(s==="rename"){const r=t.path.substring(0,t.path.lastIndexOf(i))+i+e.trim();await Yt.renameFile(t.path,r)}this.refresh()}catch(i){console.error("Operation failed:",i),this.$message.error("操作失败")}this.inputDialog.visible=!1},cancelInput(){this.inputDialog.visible=!1},async deleteItem(){this.hideContextMenu();try{await this.$confirm(`确定要删除 "${this.contextMenu.target.name}" 吗?`,"确认删除",{confirmButtonText:"删除",cancelButtonText:"取消",type:"warning"}),await Yt.deleteFile(this.contextMenu.target.path),this.$message.success("删除成功"),this.refresh()}catch(s){s!=="cancel"&&(console.error("Delete failed:",s),this.$message.error("删除失败"))}},triggerFileUpload(){var s;this.hideContextMenu(),(s=this.$refs.fileInput)==null||s.click()},handleFileSelect(s){var i,n;const e=(i=s.target.files)==null?void 0:i[0];if(!e)return;const t=(n=this.contextMenu.target)==null?void 0:n.path;t&&(this.uploadFile(e,t),s.target.value="")},uploadFile(s,e){this.uploadProgress={visible:!0,percent:0,filename:s.name,cancelled:!1},Yt.uploadFilesystemWithProgress(e,s,t=>{this.uploadProgress.percent=t}).then(()=>{this.uploadProgress.visible=!1,this.$message.success("上传成功"),this.refresh()}).catch(t=>{this.uploadProgress.visible=!1,this.$message.error("上传失败: "+t.message)})},cancelUpload(){this.uploadProgress.cancelled=!0,this.uploadProgress.visible=!1},downloadFile(){this.hideContextMenu();const s=this.contextMenu.target;s&&(this.downloadProgress={visible:!0,percent:0,filename:s.name,cancelled:!1},Yt.downloadFilesystemWithProgress(s.path,s.name,e=>{this.downloadProgress.percent=e}).then(()=>{this.downloadProgress.visible=!1}).catch(e=>{this.downloadProgress.visible=!1,this.$message.error("下载失败: "+e.message)}))},cancelDownload(){this.downloadProgress.cancelled=!0,this.downloadProgress.visible=!1},initEditor(){this.editor||this.$refs.editorContainer&&(this.editor=$b.create(this.$refs.editorContainer,{value:"",language:"plaintext",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:14,fontFamily:'Consolas, Monaco, "Courier New", monospace',lineNumbers:"on",roundedSelection:!1,scrollbar:{useShadows:!1,verticalHasArrows:!1,horizontalHasArrows:!1,vertical:"auto",horizontal:"auto"}}),this.editor.onDidChangeModelContent(()=>{this.$forceUpdate()}),this.editor.addCommand(l3.CtrlCmd|a3.KeyS,()=>{this.saveFile()}))},getFileIcon(s){const e=s.split(".").pop().toLowerCase(),t=s.toLowerCase();return t==="dockerfile"?"fa-brands fa-docker text-blue-400":t===".gitignore"?"fa-brands fa-git text-red-400":t.startsWith("readme")?this.fileIcons.md:this.fileIcons[e]||"fa-solid fa-file text-gray-400"},getLanguageFromFilename(s){const e=s.split(".").pop().toLowerCase();return{js:"javascript",ts:"typescript",html:"html",css:"css",scss:"scss",vue:"html",py:"python",md:"markdown",json:"json",yaml:"yaml",yml:"yaml",xml:"xml",sql:"sql",sh:"shell",go:"go",rs:"rust"}[e]||"plaintext"}}};var Cft=function(){var i;var e=this,t=e._self._c;return t("div",{staticClass:"flex-1 flex overflow-hidden"},[t("aside",{staticClass:"bg-sidebar border-r border-border flex flex-col shrink-0",style:{width:e.sidebarWidth+"px"}},[e._m(0),t("div",{staticClass:"flex items-center gap-1 px-2 py-2 border-b border-border"},[t("button",{staticClass:"p-1 text-textMuted hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",attrs:{disabled:!e.browseResult.parent_path&&e.browseResult.parent_path!=="",title:"上级目录"},on:{click:e.goUp}},[t("i",{staticClass:"fa-solid fa-arrow-up"})]),t("button",{staticClass:"p-1 text-textMuted hover:text-white",attrs:{title:"刷新"},on:{click:e.refresh}},[t("i",{staticClass:"fa-solid fa-refresh"})]),t("button",{staticClass:"p-1 text-textMuted hover:text-white",attrs:{title:"我的电脑"},on:{click:e.goHome}},[t("i",{staticClass:"fa-solid fa-home"})])]),t("div",{staticClass:"flex-1 overflow-y-auto py-1 sidebar-scroll"},[e.loading?t("div",{staticClass:"flex items-center justify-center py-8 text-textMuted"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.fileTreeData.length===0?t("div",{staticClass:"flex items-center justify-center py-8 text-textMuted text-sm"},[e._v(" 此目录为空 ")]):e._l(e.fileTreeData,function(n){return t("file-tree-node",{key:n.path,attrs:{node:n,level:0,"selected-path":e.selectedPath},on:{select:e.handleSelect,"open-file":e.openFile,"load-children":e.handleLoadChildren,contextmenu:e.showContextMenu}})})],2),t("div",{directives:[{name:"show",rawName:"v-show",value:e.contextMenu.visible,expression:"contextMenu.visible"}],staticClass:"fixed bg-sidebar border border-border rounded shadow-lg py-1 z-50 min-w-[160px]",style:{left:e.contextMenu.x+"px",top:e.contextMenu.y+"px"}},[(i=e.contextMenu.target)!=null&&i.is_directory?[t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.copyPath}},[t("i",{staticClass:"fa-solid fa-copy text-xs"}),e._v(" 复制路径 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.createNewFile}},[t("i",{staticClass:"fa-solid fa-file-lines text-xs"}),e._v(" 新建文件 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.createNewFolder}},[t("i",{staticClass:"fa-solid fa-folder-plus text-xs"}),e._v(" 新建文件夹 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.triggerFileUpload}},[t("i",{staticClass:"fa-solid fa-upload text-xs"}),e._v(" 上传文件 ")]),t("div",{staticClass:"border-t border-border my-1"}),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.renameItem}},[t("i",{staticClass:"fa-solid fa-pen text-xs"}),e._v(" 重命名 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-red-400 hover:bg-active flex items-center gap-2",on:{click:e.deleteItem}},[t("i",{staticClass:"fa-solid fa-trash text-xs"}),e._v(" 删除 ")])]:[t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.copyPath}},[t("i",{staticClass:"fa-solid fa-copy text-xs"}),e._v(" 复制路径 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.downloadFile}},[t("i",{staticClass:"fa-solid fa-download text-xs"}),e._v(" 下载 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.renameItem}},[t("i",{staticClass:"fa-solid fa-pen text-xs"}),e._v(" 重命名 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-red-400 hover:bg-active flex items-center gap-2",on:{click:e.deleteItem}},[t("i",{staticClass:"fa-solid fa-trash text-xs"}),e._v(" 删除 ")])]],2),t("div",{directives:[{name:"show",rawName:"v-show",value:e.inputDialog.visible,expression:"inputDialog.visible"}],staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",on:{click:function(n){return n.target!==n.currentTarget?null:e.cancelInput.apply(null,arguments)}}},[t("div",{staticClass:"bg-sidebar border border-border rounded p-4 w-80"},[t("p",{staticClass:"text-white text-sm mb-3"},[e._v(e._s(e.inputDialog.title))]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.inputDialog.value,expression:"inputDialog.value"}],ref:"renameInput",staticClass:"w-full px-3 py-2 bg-[#1e1e1e] border border-border rounded text-white text-sm focus:outline-none focus:border-accent",attrs:{placeholder:e.inputDialog.placeholder},domProps:{value:e.inputDialog.value},on:{keyup:[function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.confirmInput.apply(null,arguments)},function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"escape",void 0,n.key,void 0)?null:e.cancelInput.apply(null,arguments)}],input:function(n){n.target.composing||e.$set(e.inputDialog,"value",n.target.value)}}}),t("div",{staticClass:"flex justify-end gap-2 mt-4"},[t("button",{staticClass:"px-3 py-1 text-xs text-textMuted hover:text-white",on:{click:e.cancelInput}},[e._v("取消")]),t("button",{staticClass:"px-3 py-1 text-xs bg-accent text-white rounded hover:bg-blue-600",on:{click:e.confirmInput}},[e._v("确定")])])])]),t("input",{ref:"fileInput",staticClass:"hidden",attrs:{type:"file"},on:{change:e.handleFileSelect}}),e.uploadProgress.visible?t("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50"},[t("div",{staticClass:"bg-sidebar border border-border rounded p-4 w-80"},[t("p",{staticClass:"text-white text-sm mb-3"},[e._v("正在上传 "+e._s(e.uploadProgress.filename))]),t("div",{staticClass:"w-full bg-[#1e1e1e] rounded-full h-2"},[t("div",{staticClass:"bg-accent h-2 rounded-full transition-all",style:{width:e.uploadProgress.percent+"%"}})]),t("p",{staticClass:"text-textMuted text-xs mt-2 text-center"},[e._v(e._s(e.uploadProgress.percent)+"%")]),t("button",{staticClass:"w-full mt-4 py-2 text-xs text-textMuted hover:text-white border border-border rounded",on:{click:e.cancelUpload}},[e._v("取消")])])]):e._e(),e.downloadProgress.visible?t("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50"},[t("div",{staticClass:"bg-sidebar border border-border rounded p-4 w-80"},[t("p",{staticClass:"text-white text-sm mb-3"},[e._v("正在下载 "+e._s(e.downloadProgress.filename))]),t("div",{staticClass:"w-full bg-[#1e1e1e] rounded-full h-2"},[t("div",{staticClass:"bg-accent h-2 rounded-full transition-all",style:{width:e.downloadProgress.percent+"%"}})]),t("p",{staticClass:"text-textMuted text-xs mt-2 text-center"},[e._v(e._s(e.downloadProgress.percent)+"%")]),t("button",{staticClass:"w-full mt-4 py-2 text-xs text-textMuted hover:text-white border border-border rounded",on:{click:e.cancelDownload}},[e._v("取消")])])]):e._e()]),t("div",{staticClass:"w-1 bg-border hover:bg-accent cursor-col-resize transition-colors",on:{mousedown:e.startResize}}),t("main",{staticClass:"flex-1 flex flex-col min-w-0 bg-[#1e1e1e]"},[t("div",{staticClass:"flex border-b border-border bg-sidebar overflow-x-auto"},e._l(e.openFiles,function(n){var r;return t("div",{key:n.path,staticClass:"flex items-center gap-2 px-3 py-2 cursor-pointer border-r border-border",class:((r=e.activeFile)==null?void 0:r.path)===n.path?"bg-[#1e1e1e] text-white border-t-2 border-t-accent":"text-textMuted hover:bg-[#2a2a2a]",on:{click:function(o){e.activeFile=n}}},[t("i",{staticClass:"text-xs",class:e.getFileIcon(n.name)}),t("span",{staticClass:"text-xs"},[e._v(e._s(n.name))]),t("button",{staticClass:"ml-2 hover:text-white text-textMuted",on:{click:function(o){return o.stopPropagation(),e.closeFile(n)}}},[t("i",{staticClass:"fa-solid fa-times text-[10px]"})])])}),0),t("div",{staticClass:"flex-1 overflow-hidden"},[e.activeFile?e.fileLoading?t("div",{staticClass:"flex items-center justify-center h-full text-textMuted"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.isBinaryFile?t("div",{staticClass:"flex items-center justify-center h-full text-textMuted"},[e._m(1)]):e._e():t("div",{staticClass:"text-textMuted text-center mt-20"},[t("i",{staticClass:"fa-solid fa-file-code text-6xl mb-4 opacity-20"}),t("p",[e._v("双击左侧文件打开编辑器")])]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.activeFile&&!e.isBinaryFile,expression:"activeFile && !isBinaryFile"}],ref:"editorContainer",staticClass:"monaco-editor-container"})]),e.activeFile&&!e.isBinaryFile?t("div",{staticClass:"h-8 bg-sidebar border-t border-border flex items-center justify-between px-3"},[t("div",{staticClass:"flex items-center gap-4 text-xs text-textMuted"},[t("span",[e._v(e._s(e.activeFile.path))]),e.hasChanges?t("span",{staticClass:"text-yellow-500"},[e._v("已修改")]):e._e()]),t("div",{staticClass:"flex items-center gap-2"},[t("button",{staticClass:"px-3 py-1 text-xs bg-primary hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed text-white rounded",attrs:{disabled:!e.hasChanges||e.saving},on:{click:e.saveFile}},[e.saving?t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-1"}):t("i",{staticClass:"fa-solid fa-save mr-1"}),e._v(" 保存 ")])])]):e._e()]),t("CopyPathDialog",{ref:"copyPathDialog"})],1)},yft=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"flex border-b border-border text-xs uppercase font-bold text-textMuted"},[e("div",{staticClass:"px-4 py-2 border-b-2 border-accent text-white flex items-center gap-2"},[e("i",{staticClass:"fa-solid fa-folder-open"}),s._v(" Explorer ")])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fa-solid fa-file text-4xl mb-4 opacity-30"}),e("p",[s._v("二进制文件无法预览")])])}],wft=en(bft,Cft,yft,!1,null,"6c7f29aa");const Sft=wft.exports,xft={name:"SkillRepositories",props:{repositories:{type:Array,default:()=>[]},repoSkills:{type:Object,default:()=>({})},loadingSkills:{type:Object,default:()=>({})},downloadingAll:{type:Object,default:()=>({})}},data(){return{expandedRepos:new Set}},methods:{toggleExpand(s){this.expandedRepos.has(s)?this.expandedRepos.delete(s):(this.expandedRepos.add(s),this.repoSkills[s]||this.$emit("load-skills",s)),this.expandedRepos=new Set(this.expandedRepos)}}};var kft=function(){var e=this,t=e._self._c;return t("div",{staticClass:"skill-repositories"},[t("div",{staticClass:"flex justify-between items-center mb-4"},[t("h3",{staticClass:"text-lg text-white font-light"},[e._v("Remote Repositories")]),t("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(i){return e.$emit("add")}}},[t("i",{staticClass:"fa-solid fa-plus mr-1"}),e._v(" Add Repository ")])],1),e.repositories.length===0?t("div",{staticClass:"text-center text-textMuted py-8"},[t("i",{staticClass:"fa-solid fa-server text-4xl mb-4 opacity-30"}),t("p",[e._v("No repositories configured")])]):t("div",{staticClass:"space-y-2"},e._l(e.repositories,function(i){return t("div",{key:i.id,staticClass:"bg-sidebar border border-border rounded overflow-hidden"},[t("div",{staticClass:"repo-header p-3 flex items-center gap-3 cursor-pointer hover:bg-white/5",on:{click:function(n){return e.toggleExpand(i.id)}}},[t("span",{staticClass:"expand-icon text-textMuted text-xs transition-transform",class:{"rotate-90":e.expandedRepos.has(i.id)}},[t("i",{staticClass:"fa-solid fa-chevron-right"})]),t("div",{staticClass:"flex-1 min-w-0"},[t("div",{staticClass:"flex items-center gap-2"},[t("span",{staticClass:"text-white font-medium text-sm truncate"},[e._v(e._s(i.name))]),i.isSynced?t("el-tag",{attrs:{type:"success",size:"mini"}},[e._v("Synced")]):t("el-tag",{attrs:{type:"info",size:"mini"}},[e._v("Not Synced")])],1),t("div",{staticClass:"text-textMuted text-xs truncate mt-1"},[e._v(e._s(i.url))])]),t("div",{staticClass:"flex items-center gap-2"},[t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(n){return n.stopPropagation(),e.$emit("sync",i)}}},[e._v("Sync")]),t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(n){return n.stopPropagation(),e.$emit("edit",i)}}},[e._v("Edit")]),t("el-button",{staticClass:"delete-btn",attrs:{type:"text",size:"small"},on:{click:function(n){return n.stopPropagation(),e.$emit("delete",i.id)}}},[e._v("Delete")])],1)]),t("div",{staticClass:"skills-panel border-t border-border",class:{hidden:!e.expandedRepos.has(i.id)}},[t("div",{staticClass:"p-3 bg-black/20"},[i.isSynced?t("div",[t("div",{staticClass:"flex justify-between items-center mb-2"},[t("div",{staticClass:"text-textMuted text-xs"},[e._v(" Last sync: "+e._s(i.last_sync_at?new Date(i.last_sync_at).toLocaleString():"Never")+" ")]),e.repoSkills[i.id]&&e.repoSkills[i.id].length>0?t("el-button",{attrs:{type:"text",size:"small",loading:e.downloadingAll[i.id]},on:{click:function(n){return n.stopPropagation(),e.$emit("download-all",i.id)}}},[e._v(" Install All ")]):e._e()],1),t("div",{staticClass:"space-y-1"},[e.loadingSkills[i.id]?t("div",{staticClass:"text-textMuted text-xs"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-1"}),e._v(" Loading skills... ")]):!e.repoSkills[i.id]||e.repoSkills[i.id].length===0?t("div",{staticClass:"text-textMuted text-xs"},[e._v(" No skills found in this repository. ")]):e._l(e.repoSkills[i.id],function(n){return t("div",{key:n.name,staticClass:"flex items-center justify-between py-1"},[t("div",{staticClass:"flex items-center gap-2"},[t("span",{staticClass:"text-sm text-textMain"},[e._v(e._s(n.name))]),n.license?t("el-tag",{attrs:{type:"warning",size:"mini"}},[e._v(e._s(n.license))]):e._e()],1),t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(r){return e.$emit("download-skill",i.id,n.name)}}},[e._v("Install")])],1)})],2)]):t("div",{staticClass:"text-textMuted text-xs"},[t("i",{staticClass:"fa-solid fa-info-circle mr-1"}),e._v(" Click Sync to clone the repository ")])])])])}),0)])},Lft=[],Dft=en(xft,kft,Lft,!1,null,"38820e94");const Ift=Dft.exports,Eft={name:"RemoteSkills",components:{SkillRepositories:Ift},props:{repositories:{type:Array,default:()=>[]},repoSkills:{type:Object,default:()=>({})},loadingSkills:{type:Object,default:()=>({})},downloadingAll:{type:Object,default:()=>({})}}};var Tft=function(){var e=this,t=e._self._c;return t("div",[t("SkillRepositories",{attrs:{repositories:e.repositories,"repo-skills":e.repoSkills,"loading-skills":e.loadingSkills,"downloading-all":e.downloadingAll},on:{add:function(i){return e.$emit("add")},edit:function(i){return e.$emit("edit",i)},delete:function(i){return e.$emit("delete",i)},sync:function(i){return e.$emit("sync",i)},"load-skills":function(i){return e.$emit("load-skills",i)},"download-skill":(...i)=>e.$emit("download-skill",...i),"download-all":function(i){return e.$emit("download-all",i)}}})],1)},Nft=[],Mft=en(Eft,Tft,Nft,!1,null,null);const Rft=Mft.exports,Pft={name:"LocalSkillsList",props:{skills:{type:Array,default:()=>[]}}};var Oft=function(){var e=this,t=e._self._c;return t("div",{staticClass:"local-skills-list"},[e._m(0),e.skills.length===0?t("div",{staticClass:"text-center text-textMuted py-8"},[t("i",{staticClass:"fa-solid fa-folder-open text-4xl mb-4 opacity-30"}),t("p",[e._v("No local skills")]),t("p",{staticClass:"text-xs mt-2"},[e._v("Download from repositories to install skills")])]):t("div",{staticClass:"space-y-2"},e._l(e.skills,function(i){return t("div",{key:i.name,staticClass:"bg-sidebar border border-border p-3 rounded flex justify-between items-start hover:border-accent group"},[t("div",{staticClass:"flex gap-3 flex-1 min-w-0"},[e._m(1,!0),t("div",{staticClass:"min-w-0 flex-1"},[t("div",{staticClass:"flex items-center gap-2"},[t("h4",{staticClass:"text-white font-bold text-sm"},[e._v(e._s(i.name))])]),t("p",{staticClass:"text-textMuted text-xs mt-1 line-clamp-2"},[e._v(e._s(i.description||"No description"))])])]),t("div",{staticClass:"flex items-center gap-2 ml-4"},[t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(n){return e.$emit("view",i)}}},[t("i",{staticClass:"fa-solid fa-eye"})]),t("el-button",{staticClass:"delete-btn",attrs:{type:"text",size:"small"},on:{click:function(n){return e.$emit("delete",i.name)}}},[t("i",{staticClass:"fa-solid fa-trash"})])],1)])}),0)])},Aft=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"mb-4"},[e("p",{staticClass:"text-textMuted text-xs mb-4"},[s._v(" Local skills are stored in the "),e("code",{staticClass:"bg-black/30 px-1 rounded"},[s._v(".txcode/skills/")]),s._v(" directory ")])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"w-10 h-10 rounded flex items-center justify-center text-xl bg-green-900/30 text-green-400 shrink-0"},[e("i",{staticClass:"fa-solid fa-bolt"})])}],Fft=en(Pft,Oft,Aft,!1,null,"ffae3d26");const Bft=Fft.exports,Wft={name:"SkillRepositoryDialog",props:{visible:{type:Boolean,default:!1},repository:{type:Object,default:null}},data(){return{form:{name:"",url:""},rules:{name:[{required:!0,message:"Please enter repository name",trigger:"blur"}],url:[{required:!0,message:"Please enter repository URL",trigger:"blur"},{type:"url",message:"Please enter a valid URL",trigger:"blur"}]}}},computed:{dialogVisible:{get(){return this.visible},set(s){this.$emit("update:visible",s)}},isEdit(){return!!this.repository}},watch:{repository:{immediate:!0,handler(s){s?(this.form.name=s.name,this.form.url=s.url):(this.form.name="",this.form.url="")}}},methods:{handleClose(){var s;(s=this.$refs.form)==null||s.resetFields(),this.$emit("close")},handleSubmit(){this.$refs.form.validate(s=>{var e;s&&(this.$emit("submit",{id:(e=this.repository)==null?void 0:e.id,name:this.form.name,url:this.form.url,type:"custom"}),this.handleClose())})}}};var Vft=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.isEdit?"Edit Repository":"Add Repository",visible:e.dialogVisible,width:"500px"},on:{"update:visible":function(i){e.dialogVisible=i},close:e.handleClose}},[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"100px"}},[t("el-form-item",{attrs:{label:"Name",prop:"name"}},[t("el-input",{attrs:{placeholder:"Repository name"},model:{value:e.form.name,callback:function(i){e.$set(e.form,"name",i)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"URL",prop:"url"}},[t("el-input",{attrs:{placeholder:"Git repository URL"},scopedSlots:e._u([{key:"append",fn:function(){return[t("el-tooltip",{attrs:{content:"Can be a Gitee/GitHub repository URL"}},[t("i",{staticClass:"fa-solid fa-info-circle text-textMuted"})])]},proxy:!0}]),model:{value:e.form.url,callback:function(i){e.$set(e.form,"url",i)},expression:"form.url"}})],1)],1),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.handleClose}},[e._v("Cancel")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleSubmit}},[e._v("Confirm")])],1)],1)},Hft=[],$ft=en(Wft,Vft,Hft,!1,null,null);const zft=$ft.exports,jft={name:"SkillViewer",props:{visible:{type:Boolean,default:!1},skill:{type:Object,default:null},content:{type:String,default:""}},computed:{dialogVisible:{get(){return this.visible},set(s){this.$emit("update:visible",s)}}}};var Uft=function(){var e=this,t=e._self._c;return t("el-dialog",{staticClass:"skill-viewer-dialog",attrs:{title:"Skill Content",visible:e.dialogVisible,width:"800px"},on:{"update:visible":function(i){e.dialogVisible=i}}},[e.skill?t("div",{staticClass:"max-h-[60vh] overflow-y-auto"},[t("div",{staticClass:"mb-4"},[t("h3",{staticClass:"text-lg font-bold text-white"},[e._v(e._s(e.skill.name))]),t("p",{staticClass:"text-textMuted text-sm mt-1"},[e._v(e._s(e.skill.description))])]),t("pre",{staticClass:"bg-sidebar p-4 rounded text-sm text-textMain overflow-x-auto whitespace-pre-wrap"},[e._v(e._s(e.content))])]):e._e()])},qft=[],Kft=en(jft,Uft,qft,!1,null,"0d2983b8");const Gft=Kft.exports,Yft={name:"SpecRepositories",props:{repositories:{type:Array,default:()=>[]},repoSpecs:{type:Object,default:()=>({})},loadingSpecs:{type:Object,default:()=>({})},downloadingAll:{type:Object,default:()=>({})}},data(){return{expandedRepos:new Set}},methods:{toggleExpand(s){this.expandedRepos.has(s)?this.expandedRepos.delete(s):(this.expandedRepos.add(s),this.repoSpecs[s]||this.$emit("load-specs",s)),this.expandedRepos=new Set(this.expandedRepos)}}};var Zft=function(){var e=this,t=e._self._c;return t("div",{staticClass:"spec-repositories"},[t("div",{staticClass:"flex justify-between items-center mb-4"},[t("h3",{staticClass:"text-lg text-white font-light"},[e._v("Remote Repositories")]),t("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(i){return e.$emit("add")}}},[t("i",{staticClass:"fa-solid fa-plus mr-1"}),e._v(" Add Repository ")])],1),e.repositories.length===0?t("div",{staticClass:"text-center text-textMuted py-8"},[t("i",{staticClass:"fa-solid fa-server text-4xl mb-4 opacity-30"}),t("p",[e._v("No repositories configured")])]):t("div",{staticClass:"space-y-2"},e._l(e.repositories,function(i){return t("div",{key:i.id,staticClass:"bg-sidebar border border-border rounded overflow-hidden"},[t("div",{staticClass:"repo-header p-3 flex items-center gap-3 cursor-pointer hover:bg-white/5",on:{click:function(n){return e.toggleExpand(i.id)}}},[t("span",{staticClass:"expand-icon text-textMuted text-xs transition-transform",class:{"rotate-90":e.expandedRepos.has(i.id)}},[t("i",{staticClass:"fa-solid fa-chevron-right"})]),t("div",{staticClass:"flex-1 min-w-0"},[t("div",{staticClass:"flex items-center gap-2"},[t("span",{staticClass:"text-white font-medium text-sm truncate"},[e._v(e._s(i.name))]),i.isSynced?t("el-tag",{attrs:{type:"success",size:"mini"}},[e._v("Synced")]):t("el-tag",{attrs:{type:"info",size:"mini"}},[e._v("Not Synced")])],1),t("div",{staticClass:"text-textMuted text-xs truncate mt-1"},[e._v(e._s(i.url))])]),t("div",{staticClass:"flex items-center gap-2"},[t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(n){return n.stopPropagation(),e.$emit("sync",i)}}},[e._v("Sync")]),t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(n){return n.stopPropagation(),e.$emit("edit",i)}}},[e._v("Edit")]),t("el-button",{staticClass:"delete-btn",attrs:{type:"text",size:"small"},on:{click:function(n){return n.stopPropagation(),e.$emit("delete",i.id)}}},[e._v("Delete")])],1)]),t("div",{staticClass:"specs-panel border-t border-border",class:{hidden:!e.expandedRepos.has(i.id)}},[t("div",{staticClass:"p-3 bg-black/20"},[i.isSynced?t("div",[t("div",{staticClass:"flex justify-between items-center mb-2"},[t("div",{staticClass:"text-textMuted text-xs"},[e._v(" Last sync: "+e._s(i.last_sync_at?new Date(i.last_sync_at).toLocaleString():"Never")+" ")]),e.repoSpecs[i.id]&&e.repoSpecs[i.id].length>0?t("el-button",{attrs:{type:"text",size:"small",loading:e.downloadingAll[i.id]},on:{click:function(n){return n.stopPropagation(),e.$emit("download-all",i.id)}}},[e._v(" Install All ")]):e._e()],1),t("div",{staticClass:"space-y-1"},[e.loadingSpecs[i.id]?t("div",{staticClass:"text-textMuted text-xs"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-1"}),e._v(" Loading specs... ")]):!e.repoSpecs[i.id]||e.repoSpecs[i.id].length===0?t("div",{staticClass:"text-textMuted text-xs"},[e._v(" No specs found in this repository. ")]):e._l(e.repoSpecs[i.id],function(n){return t("div",{key:n.name,staticClass:"flex items-center justify-between py-1"},[t("div",{staticClass:"flex items-center gap-2"},[t("span",{staticClass:"text-sm text-textMain"},[e._v(e._s(n.name))]),n.read_mode==="required"?t("el-tag",{attrs:{type:"warning",size:"mini"}},[e._v("Required")]):t("el-tag",{attrs:{type:"info",size:"mini"}},[e._v("Optional")])],1),t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(r){return e.$emit("download-spec",i.id,n.name)}}},[e._v("Install")])],1)})],2)]):t("div",{staticClass:"text-textMuted text-xs"},[t("i",{staticClass:"fa-solid fa-info-circle mr-1"}),e._v(" Click Sync to clone the repository ")])])])])}),0)])},Xft=[],Qft=en(Yft,Zft,Xft,!1,null,"31cdb0a9");const Jft=Qft.exports,egt={name:"RemoteSpecs",components:{SpecRepositories:Jft},props:{repositories:{type:Array,default:()=>[]},repoSpecs:{type:Object,default:()=>({})},loadingSpecs:{type:Object,default:()=>({})},downloadingAll:{type:Object,default:()=>({})}}};var tgt=function(){var e=this,t=e._self._c;return t("div",[t("SpecRepositories",{attrs:{repositories:e.repositories,"repo-specs":e.repoSpecs,"loading-specs":e.loadingSpecs,"downloading-all":e.downloadingAll},on:{add:function(i){return e.$emit("add")},edit:function(i){return e.$emit("edit",i)},delete:function(i){return e.$emit("delete",i)},sync:function(i){return e.$emit("sync",i)},"load-specs":function(i){return e.$emit("load-specs",i)},"download-spec":(...i)=>e.$emit("download-spec",...i),"download-all":function(i){return e.$emit("download-all",i)}}})],1)},igt=[],ngt=en(egt,tgt,igt,!1,null,null);const sgt=ngt.exports,rgt={name:"LocalSpecsList",props:{specs:{type:Array,default:()=>[]}}};var ogt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"local-specs-list"},[e._m(0),e.specs.length===0?t("div",{staticClass:"text-center text-textMuted py-8"},[t("i",{staticClass:"fa-solid fa-folder-open text-4xl mb-4 opacity-30"}),t("p",[e._v("No local specs")]),t("p",{staticClass:"text-xs mt-2"},[e._v("Download from repositories or upload new specs")])]):t("div",{staticClass:"space-y-2"},e._l(e.specs,function(i){return t("div",{key:i.name,staticClass:"bg-sidebar border border-border p-3 rounded flex justify-between items-start hover:border-accent group"},[t("div",{staticClass:"flex gap-3 flex-1 min-w-0"},[e._m(1,!0),t("div",{staticClass:"min-w-0 flex-1"},[t("div",{staticClass:"flex items-center gap-2"},[t("h4",{staticClass:"text-white font-bold text-sm"},[e._v(e._s(i.name))]),i.read_mode==="required"?t("el-tag",{attrs:{type:"warning",size:"mini"}},[e._v("Required")]):t("el-tag",{attrs:{type:"info",size:"mini"}},[e._v("Optional")])],1),t("p",{staticClass:"text-textMuted text-xs mt-1 line-clamp-2"},[e._v(e._s(i.description||"No description"))])])]),t("div",{staticClass:"flex items-center gap-2 ml-4"},[t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(n){return e.$emit("view",i)}}},[t("i",{staticClass:"fa-solid fa-eye"})]),t("el-button",{staticClass:"delete-btn",attrs:{type:"text",size:"small"},on:{click:function(n){return e.$emit("delete",i.name)}}},[t("i",{staticClass:"fa-solid fa-trash"})])],1)])}),0)])},agt=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"mb-4"},[e("p",{staticClass:"text-textMuted text-xs mb-4"},[s._v(" Local specs are stored in the "),e("code",{staticClass:"bg-black/30 px-1 rounded"},[s._v("~/.txcode/specs/")]),s._v(" directory ")])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"w-10 h-10 rounded flex items-center justify-center text-xl bg-blue-900/30 text-blue-400 shrink-0"},[e("i",{staticClass:"fa-solid fa-file-alt"})])}],lgt=en(rgt,ogt,agt,!1,null,"616c14ac");const cgt=lgt.exports,dgt={name:"SpecRepositoryDialog",props:{visible:{type:Boolean,default:!1},repository:{type:Object,default:null}},data(){return{form:{name:"",url:""},rules:{name:[{required:!0,message:"Please enter repository name",trigger:"blur"}],url:[{required:!0,message:"Please enter repository URL",trigger:"blur"},{type:"url",message:"Please enter a valid URL",trigger:"blur"}]}}},computed:{dialogVisible:{get(){return this.visible},set(s){this.$emit("update:visible",s)}},isEdit(){return!!this.repository}},watch:{repository:{immediate:!0,handler(s){s?(this.form.name=s.name,this.form.url=s.url):(this.form.name="",this.form.url="")}}},methods:{handleClose(){var s;(s=this.$refs.form)==null||s.resetFields(),this.$emit("close")},handleSubmit(){this.$refs.form.validate(s=>{var e;s&&(this.$emit("submit",{id:(e=this.repository)==null?void 0:e.id,name:this.form.name,url:this.form.url,type:"custom"}),this.handleClose())})}}};var ugt=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.isEdit?"Edit Repository":"Add Repository",visible:e.dialogVisible,width:"500px"},on:{"update:visible":function(i){e.dialogVisible=i},close:e.handleClose}},[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"100px"}},[t("el-form-item",{attrs:{label:"Name",prop:"name"}},[t("el-input",{attrs:{placeholder:"Repository name"},model:{value:e.form.name,callback:function(i){e.$set(e.form,"name",i)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"URL",prop:"url"}},[t("el-input",{attrs:{placeholder:"Git repository URL"},scopedSlots:e._u([{key:"append",fn:function(){return[t("el-tooltip",{attrs:{content:"Can be a Gitee/GitHub repository URL"}},[t("i",{staticClass:"fa-solid fa-info-circle text-textMuted"})])]},proxy:!0}]),model:{value:e.form.url,callback:function(i){e.$set(e.form,"url",i)},expression:"form.url"}})],1)],1),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.handleClose}},[e._v("Cancel")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleSubmit}},[e._v("Confirm")])],1)],1)},hgt=[],fgt=en(dgt,ugt,hgt,!1,null,null);const ggt=fgt.exports,pgt={name:"SpecViewer",props:{visible:{type:Boolean,default:!1},spec:{type:Object,default:null},content:{type:String,default:""}},computed:{dialogVisible:{get(){return this.visible},set(s){this.$emit("update:visible",s)}}}};var mgt=function(){var e=this,t=e._self._c;return t("el-dialog",{staticClass:"spec-viewer-dialog",attrs:{title:"Spec Content",visible:e.dialogVisible,width:"800px"},on:{"update:visible":function(i){e.dialogVisible=i}}},[e.spec?t("div",{staticClass:"max-h-[60vh] overflow-y-auto"},[t("div",{staticClass:"mb-4"},[t("h3",{staticClass:"text-lg font-bold text-white"},[e._v(e._s(e.spec.name))]),t("p",{staticClass:"text-textMuted text-sm mt-1"},[e._v(e._s(e.spec.description))])]),t("pre",{staticClass:"bg-sidebar p-4 rounded text-sm text-textMain overflow-x-auto whitespace-pre-wrap"},[e._v(e._s(e.content))])]):e._e()])},_gt=[],vgt=en(pgt,mgt,_gt,!1,null,"3ddd959e");const bgt=vgt.exports,Cgt={name:"MemoryDisplay",props:{items:{type:Array,default:()=>[]}}};var ygt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"memory-display"},[e.items.length===0?t("div",{staticClass:"text-textMuted text-center py-8"},[e._v(" No memories yet. Click the edit button to add some. ")]):t("div",{staticClass:"space-y-4"},e._l(e.items,function(i,n){return t("div",{key:n,staticClass:"bg-sidebar rounded p-4 border border-border"},[t("div",{staticClass:"text-white whitespace-pre-wrap"},[e._v(e._s(i.content))]),i.description?t("div",{staticClass:"text-textMuted text-sm mt-2 whitespace-pre-wrap"},[e._v(e._s(i.description))]):e._e()])}),0)])},wgt=[],Sgt=en(Cgt,ygt,wgt,!1,null,null);const xgt=Sgt.exports,kgt={name:"MemoryEditDialog",props:{visible:{type:Boolean,default:!1},content:{type:String,default:""}},data(){return{editContent:""}},computed:{dialogVisible:{get(){return this.visible},set(s){this.$emit("update:visible",s)}}},watch:{content(s){this.editContent=s}},methods:{handleClose(){this.$emit("update:visible",!1),this.$emit("close")},handleSave(){this.$emit("update:visible",!1),this.$emit("save",this.editContent)}}};var Lgt=function(){var e=this,t=e._self._c;return t("el-dialog",{staticClass:"memory-edit-dialog",attrs:{title:"Edit Memory",visible:e.dialogVisible,width:"800px"},on:{"update:visible":function(i){e.dialogVisible=i},close:e.handleClose}},[t("div",{staticClass:"mb-2 text-textMuted text-sm"},[e._v(' Format: memory content followed by optional description after "---", separated by § ')]),t("el-input",{staticClass:"w-full",attrs:{type:"textarea",rows:15},model:{value:e.editContent,callback:function(i){e.editContent=i},expression:"editContent"}}),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.handleClose}},[e._v("Cancel")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleSave}},[e._v("Save")])],1)],1)},Dgt=[],Igt=en(kgt,Lgt,Dgt,!1,null,"af0de4d7");const Egt=Igt.exports,Tgt={name:"Skills",components:{RemoteSkills:Rft,LocalSkillsList:Bft,SkillRepositoryDialog:zft,SkillViewer:Gft,RemoteSpecs:sgt,LocalSpecsList:cgt,SpecRepositoryDialog:ggt,SpecViewer:bgt,MemoryDisplay:xgt,MemoryEditDialog:Egt},data(){return{subTab:"remoteSkills",filterText:"",skillRepositories:[],repoSkills:{},loadingSkills:{},downloadingAll:{},localSkills:[],repositories:[],repoSpecs:{},loadingSpecs:{},downloadingAllSpecs:{},localSpecs:[],showAddDialog:!1,editingRepo:null,showAddSkillDialog:!1,editingSkillRepo:null,showSpecViewer:!1,currentSpec:null,currentSpecContent:"",showSkillViewer:!1,currentSkill:null,currentSkillContent:"",projectPath:"",memoryItems:[],memoryRawContent:"",showMemoryEdit:!1}},computed:{filteredSkills(){if(!this.filterText)return this.localSkills;const s=this.filterText.toLowerCase();return this.localSkills.filter(e=>{var t;return e.name.toLowerCase().includes(s)||((t=e.description)==null?void 0:t.toLowerCase().includes(s))})}},watch:{subTab(s){s==="memory"&&this.projectPath&&this.loadMemory()}},async created(){await this.loadProjectPath(),await this.loadSkillRepositories(),await this.loadLocalSkills(),await this.loadRepositories(),await this.loadLocalSpecs(),this.subTab==="memory"&&await this.loadMemory()},methods:{async loadProjectPath(){try{const s=await Yt.getProjectPath();s.success&&s.data&&(this.projectPath=s.data.path||"")}catch(s){console.error("Failed to load project path:",s)}},async loadSkillRepositories(){try{const s=await Yt.getSkillRepositories();this.skillRepositories=s.data||[]}catch(s){console.error("Failed to load skill repositories:",s),this.skillRepositories=[]}},async loadRepoSKills(s){this.$set(this.loadingSkills,s,!0);try{const e=await Yt.getRemoteSkills(s);this.$set(this.repoSkills,s,e.data||[])}catch(e){console.error("Failed to load repo skills:",e),this.$set(this.repoSkills,s,[])}finally{this.$set(this.loadingSkills,s,!1)}},async loadLocalSkills(){try{const s=await Yt.getLocalSkills(this.projectPath);this.localSkills=s.data||[]}catch(s){console.error("Failed to load local skills:",s),this.localSkills=[]}},handleEditSkillRepo(s){this.editingSkillRepo=s,this.showAddSkillDialog=!0},async handleSubmitSkillRepo(s){try{s.id?await Yt.updateSkillRepository(s.id,s):await Yt.createSkillRepository(s),await this.loadSkillRepositories(),this.editingSkillRepo=null}catch(e){console.error("Failed to submit skill repository:",e),this.$message.error("Failed to submit repository")}},async handleDeleteSkillRepo(s){try{await this.$confirm("Are you sure you want to delete this repository?","Confirm",{type:"warning"}),await Yt.deleteSkillRepository(s),await this.loadSkillRepositories(),this.$message.success("Repository deleted")}catch(e){e!=="cancel"&&console.error("Failed to delete repository:",e)}},async handleSyncSkillRepo(s){var e,t;try{const i=((t=(e=this.$message).loading)==null?void 0:t.call(e,"Syncing repository..."))||(()=>{}),n=await Yt.syncSkillRepository(s.id);i(),n.success?(this.$message.success(n.message||"Sync completed"),await this.loadSkillRepositories(),await this.loadRepoSKills(s.id)):this.$message.error(n.message||"Sync failed")}catch(i){console.error("Failed to sync repository:",i),this.$message.error("Sync failed")}},async handleDownloadSkill(s,e){var t;try{const i=await Yt.downloadSkill(s,e,this.projectPath);this.$message.success(`Downloaded ${e} to ${((t=i.data)==null?void 0:t.projectPath)||this.projectPath}`),await this.loadLocalSkills()}catch(i){console.error("Failed to download skill:",i),this.$message.error("Download failed: "+(i.message||"Unknown error"))}},async handleDownloadAllSkills(s){var e,t,i;try{this.$set(this.downloadingAll,s,!0);const n=await Yt.downloadAllSkills(s,this.projectPath);this.$message.success(`Downloaded ${((t=(e=n.data)==null?void 0:e.downloaded)==null?void 0:t.length)||0} skills to ${((i=n.data)==null?void 0:i.projectPath)||this.projectPath}`),await this.loadLocalSkills()}catch(n){console.error("Failed to download all skills:",n),this.$message.error("Download failed: "+(n.message||"Unknown error"))}finally{this.$set(this.downloadingAll,s,!1)}},async handleViewSkill(s){try{const e=await Yt.getSkillContent(s.name);this.currentSkill=s,this.currentSkillContent=e.data,this.showSkillViewer=!0}catch(e){console.error("Failed to load skill content:",e),this.$message.error("Failed to load skill content")}},async handleDeleteLocalSkill(s){try{await this.$confirm(`Are you sure you want to delete "${s}"?`,"Confirm",{type:"warning"}),await Yt.deleteLocalSkill(s),await this.loadLocalSkills(),this.$message.success("Skill deleted")}catch(e){e!=="cancel"&&console.error("Failed to delete skill:",e)}},async loadRepositories(){try{const s=await Yt.getSpecRepositories();this.repositories=s.data||[]}catch(s){console.error("Failed to load repositories:",s),this.repositories=[]}},async loadLocalSpecs(){var s;try{const e=await Yt.getLocalSpecs(this.projectPath);this.localSpecs=((s=e.data)==null?void 0:s.specs)||[]}catch(e){console.error("Failed to load local specs:",e),this.localSpecs=[]}},async loadRepoSpecs(s){this.$set(this.loadingSpecs,s,!0);try{const e=await Yt.getRepoSpecs(s);this.$set(this.repoSpecs,s,e.data||[])}catch(e){console.error("Failed to load repo specs:",e),this.$set(this.repoSpecs,s,[])}finally{this.$set(this.loadingSpecs,s,!1)}},handleEditRepo(s){this.editingRepo=s,this.showAddDialog=!0},async handleSubmitRepo(s){try{s.id?await Yt.updateSpecRepository(s.id,s):await Yt.createSpecRepository(s),await this.loadRepositories(),this.editingRepo=null}catch(e){console.error("Failed to submit repository:",e),this.$message.error("Failed to submit repository")}},async handleDeleteRepo(s){try{await this.$confirm("Are you sure you want to delete this repository?","Confirm",{type:"warning"}),await Yt.deleteSpecRepository(s),await this.loadRepositories(),this.$message.success("Repository deleted")}catch(e){e!=="cancel"&&console.error("Failed to delete repository:",e)}},async handleSyncRepo(s){var e,t;try{const i=((t=(e=this.$message).loading)==null?void 0:t.call(e,"Syncing repository..."))||(()=>{}),n=await Yt.syncSpecRepository(s.id);i(),n.success?(this.$message.success(n.message||"Sync completed"),await this.loadRepositories(),await this.loadRepoSpecs(s.id)):this.$message.error(n.message||"Sync failed")}catch(i){console.error("Failed to sync repository:",i),this.$message.error("Sync failed")}},async handleDownloadSpec(s,e){var t;try{const i=await Yt.downloadSpec(s,e,this.projectPath);this.$message.success(`Downloaded ${e} to ${((t=i.data)==null?void 0:t.projectPath)||this.projectPath}`),await this.loadLocalSpecs()}catch(i){console.error("Failed to download spec:",i),this.$message.error("Download failed: "+(i.message||"Unknown error"))}},async handleViewSpec(s){try{const e=await Yt.getSpecContent(s.name);this.currentSpec=s,this.currentSpecContent=e.data,this.showSpecViewer=!0}catch(e){console.error("Failed to load spec content:",e),this.$message.error("Failed to load spec content")}},async handleDeleteSpec(s){try{await this.$confirm(`Are you sure you want to delete "${s}"?`,"Confirm",{type:"warning"}),await Yt.deleteLocalSpec(s),await this.loadLocalSpecs(),this.$message.success("Spec deleted")}catch(e){e!=="cancel"&&console.error("Failed to delete spec:",e)}},async handleDownloadAll(s){var e,t,i;try{this.$set(this.downloadingAllSpecs,s,!0);const n=await Yt.downloadAllSpecs(s,this.projectPath);this.$message.success(`Downloaded ${((t=(e=n.data)==null?void 0:e.downloaded)==null?void 0:t.length)||0} specs to ${((i=n.data)==null?void 0:i.projectPath)||this.projectPath}`),await this.loadLocalSpecs()}catch(n){console.error("Failed to download all specs:",n),this.$message.error("Download failed: "+(n.message||"Unknown error"))}finally{this.$set(this.downloadingAllSpecs,s,!1)}},async loadMemory(){var s,e;try{const t=await Yt.getMemory(this.projectPath);this.memoryItems=((s=t.data)==null?void 0:s.items)||[],this.memoryRawContent=((e=t.data)==null?void 0:e.rawContent)||""}catch(t){console.error("Failed to load memory:",t),this.memoryItems=[],this.memoryRawContent=""}},openMemoryEdit(){this.showMemoryEdit=!0},async handleSaveMemory(s){try{await Yt.saveMemory(this.projectPath,s),await this.loadMemory(),this.$message.success("Memory saved")}catch(e){console.error("Failed to save memory:",e),this.$message.error("Failed to save memory")}}}};var Ngt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex-1 flex overflow-hidden"},[t("aside",{staticClass:"w-[220px] bg-sidebar border-r border-border flex flex-col shrink-0 py-4"},[t("div",{staticClass:"px-4 mb-4"},[t("h2",{staticClass:"text-white font-bold text-lg mb-1"},[e._v("Skills & Specs")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.filterText,expression:"filterText"}],staticClass:"w-full bg-black/20 border border-border rounded px-2 py-1 text-xs",attrs:{type:"text",placeholder:"Filter..."},domProps:{value:e.filterText},on:{input:function(i){i.target.composing||(e.filterText=i.target.value)}}})]),t("div",{staticClass:"flex-1 overflow-y-auto"},[t("div",{staticClass:"px-4 py-1 text-xs font-bold text-textMuted uppercase mt-2"},[e._v("Skills")]),t("button",{staticClass:"w-full text-left px-4 py-2 flex items-center gap-2",class:e.subTab==="remoteSkills"?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(i){e.subTab="remoteSkills"}}},[t("i",{staticClass:"fa-solid fa-server w-4 text-center"}),e._v(" Remote Skills ")]),t("button",{staticClass:"w-full text-left px-4 py-2 flex items-center gap-2",class:e.subTab==="localSkills"?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(i){e.subTab="localSkills"}}},[t("i",{staticClass:"fa-solid fa-folder w-4 text-center"}),e._v(" Local Skills ")]),t("div",{staticClass:"px-4 py-1 text-xs font-bold text-textMuted uppercase mt-4"},[e._v("Specs")]),t("button",{staticClass:"w-full text-left px-4 py-2 flex items-center gap-2",class:e.subTab==="remote"?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(i){e.subTab="remote"}}},[t("i",{staticClass:"fa-solid fa-server w-4 text-center"}),e._v(" Remote Specs ")]),t("button",{staticClass:"w-full text-left px-4 py-2 flex items-center gap-2",class:e.subTab==="local"?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(i){e.subTab="local"}}},[t("i",{staticClass:"fa-solid fa-folder w-4 text-center"}),e._v(" Local Specs ")]),t("div",{staticClass:"px-4 py-1 text-xs font-bold text-textMuted uppercase mt-4"},[e._v("Memory")]),t("button",{staticClass:"w-full text-left px-4 py-2 flex items-center gap-2",class:e.subTab==="memory"?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(i){e.subTab="memory"}}},[t("i",{staticClass:"fa-solid fa-brain w-4 text-center"}),e._v(" 记忆 ")])])]),t("main",{staticClass:"flex-1 flex flex-col bg-[#1e1e1e] min-w-0"},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.subTab==="remoteSkills",expression:"subTab === 'remoteSkills'"}],staticClass:"flex-1 p-6 overflow-y-auto"},[t("RemoteSkills",{attrs:{repositories:e.skillRepositories,"repo-skills":e.repoSkills,"loading-skills":e.loadingSkills,"downloading-all":e.downloadingAll},on:{add:function(i){e.showAddSkillDialog=!0},edit:e.handleEditSkillRepo,delete:e.handleDeleteSkillRepo,sync:e.handleSyncSkillRepo,"load-skills":e.loadRepoSKills,"download-skill":e.handleDownloadSkill,"download-all":e.handleDownloadAllSkills}})],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.subTab==="localSkills",expression:"subTab === 'localSkills'"}],staticClass:"flex-1 p-6 overflow-y-auto"},[t("LocalSkillsList",{attrs:{skills:e.localSkills},on:{view:e.handleViewSkill,delete:e.handleDeleteLocalSkill}})],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.subTab==="remote",expression:"subTab === 'remote'"}],staticClass:"flex-1 p-6 overflow-y-auto"},[t("RemoteSpecs",{attrs:{repositories:e.repositories,"repo-specs":e.repoSpecs,"loading-specs":e.loadingSpecs,"downloading-all":e.downloadingAllSpecs},on:{add:function(i){e.showAddDialog=!0},edit:e.handleEditRepo,delete:e.handleDeleteRepo,sync:e.handleSyncRepo,"load-specs":e.loadRepoSpecs,"download-spec":e.handleDownloadSpec,"download-all":e.handleDownloadAll}})],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.subTab==="local",expression:"subTab === 'local'"}],staticClass:"flex-1 p-6 overflow-y-auto"},[t("LocalSpecsList",{attrs:{specs:e.localSpecs},on:{view:e.handleViewSpec,delete:e.handleDeleteSpec}})],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.subTab==="memory",expression:"subTab === 'memory'"}],staticClass:"flex-1 flex flex-col overflow-hidden"},[t("div",{staticClass:"flex items-center justify-between px-6 py-3 border-b border-border"},[t("h2",{staticClass:"text-lg font-bold text-white"},[e._v("记忆")]),t("el-button",{attrs:{size:"small"},on:{click:e.openMemoryEdit}},[t("i",{staticClass:"fa-solid fa-pen"})])],1),t("div",{staticClass:"flex-1 p-6 overflow-y-auto"},[t("MemoryDisplay",{attrs:{items:e.memoryItems}})],1)])]),t("SpecRepositoryDialog",{attrs:{visible:e.showAddDialog,repository:e.editingRepo},on:{"update:visible":function(i){e.showAddDialog=i},submit:e.handleSubmitRepo,close:function(i){e.editingRepo=null}}}),t("SkillRepositoryDialog",{attrs:{visible:e.showAddSkillDialog,repository:e.editingSkillRepo},on:{"update:visible":function(i){e.showAddSkillDialog=i},submit:e.handleSubmitSkillRepo,close:function(i){e.editingSkillRepo=null}}}),t("SpecViewer",{attrs:{visible:e.showSpecViewer,spec:e.currentSpec,content:e.currentSpecContent},on:{"update:visible":function(i){e.showSpecViewer=i}}}),t("SkillViewer",{attrs:{visible:e.showSkillViewer,skill:e.currentSkill,content:e.currentSkillContent},on:{"update:visible":function(i){e.showSkillViewer=i}}}),t("MemoryEditDialog",{attrs:{visible:e.showMemoryEdit,content:e.memoryRawContent},on:{"update:visible":function(i){e.showMemoryEdit=i},save:e.handleSaveMemory}})],1)},Mgt=[],Rgt=en(Tgt,Ngt,Mgt,!1,null,null);const Pgt=Rgt.exports,Ogt={name:"DbView",data(){return{tables:[],selectedTable:null,tableInfo:{},tableData:{columns:[],rows:[]},page:1,pageSize:50,totalPages:1,loading:!1}},async created(){await this.loadTables()},methods:{async loadTables(){this.loading=!0;try{const s=await Yt.getDbTables();this.tables=(s.data||[]).map(e=>e.name)}catch(s){console.error("Load tables failed:",s),this.tables=[]}finally{this.loading=!1}},async selectTable(s){this.selectedTable=s,this.page=1,await this.loadTableInfo(),await this.loadTableData()},async loadTableInfo(){if(this.selectedTable)try{const s=await Yt.getTableInfo(this.selectedTable);this.tableInfo=s.data||{},this.totalPages=Math.max(1,Math.ceil((this.tableInfo.row_count||0)/this.pageSize))}catch(s){console.error("Load table info failed:",s),this.tableInfo={}}},async loadTableData(){if(this.selectedTable)try{const s=await Yt.getTableData(this.selectedTable,this.page,this.pageSize);this.tableData={rows:s.data||[]}}catch(s){console.error("Load table data failed:",s),this.tableData={columns:[],rows:[]}}},async prevPage(){this.page>1&&(this.page--,await this.loadTableData())},async nextPage(){this.page<this.totalPages&&(this.page++,await this.loadTableData())},formatCell(s){return s===null?"<null>":s===void 0?"":typeof s=="boolean"?s?"true":"false":typeof s=="object"?JSON.stringify(s):String(s)}}};var Agt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex-1 flex overflow-hidden"},[t("aside",{staticClass:"w-[260px] bg-sidebar border-r border-border flex flex-col shrink-0"},[e._m(0),t("div",{staticClass:"flex items-center gap-1 px-2 py-2 border-b border-border"},[t("button",{staticClass:"p-1 text-textMuted hover:text-white",attrs:{title:"刷新"},on:{click:e.loadTables}},[t("i",{staticClass:"fa-solid fa-refresh"})])]),t("div",{staticClass:"flex-1 overflow-y-auto py-1"},[e.loading?t("div",{staticClass:"flex items-center justify-center py-8 text-textMuted"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.tables.length===0?t("div",{staticClass:"flex items-center justify-center py-8 text-textMuted text-sm"},[e._v(" 暂无表 ")]):t("div",e._l(e.tables,function(i){return t("div",{key:i,staticClass:"flex items-center gap-2 px-3 py-1.5 cursor-pointer text-sm",class:e.selectedTable===i?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(n){return e.selectTable(i)}}},[t("i",{staticClass:"fa-solid fa-table text-textMuted text-xs"}),t("span",{staticClass:"truncate"},[e._v(e._s(i))])])}),0)])]),t("main",{staticClass:"flex-1 flex flex-col min-w-0 bg-[#1e1e1e]"},[e.selectedTable?t("div",{staticClass:"flex-1 flex flex-col overflow-hidden"},[t("div",{staticClass:"flex items-center justify-between px-4 py-2 border-b border-border bg-sidebar"},[t("div",{staticClass:"flex items-center gap-2"},[t("i",{staticClass:"fa-solid fa-table text-textMuted"}),t("span",{staticClass:"text-sm text-white"},[e._v(e._s(e.selectedTable))]),t("span",{staticClass:"text-xs text-textMuted"},[e._v("("+e._s(e.tableInfo.row_count||0)+" 行)")])]),t("div",{staticClass:"flex items-center gap-2"},[t("button",{staticClass:"px-2 py-1 text-xs text-textMuted hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",attrs:{disabled:e.page<=1},on:{click:e.prevPage}},[t("i",{staticClass:"fa-solid fa-chevron-left"})]),t("span",{staticClass:"text-xs text-textMuted"},[e._v(e._s(e.page)+" / "+e._s(e.totalPages||1))]),t("button",{staticClass:"px-2 py-1 text-xs text-textMuted hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",attrs:{disabled:e.page>=e.totalPages},on:{click:e.nextPage}},[t("i",{staticClass:"fa-solid fa-chevron-right"})])])]),t("div",{staticClass:"flex-1 overflow-auto"},[t("table",{staticClass:"w-full text-sm"},[t("thead",{staticClass:"bg-sidebar sticky top-0"},[t("tr",e._l(e.tableInfo.columns,function(i){return t("th",{key:i.name,staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[e._v(" "+e._s(i.name)+" "),t("span",{staticClass:"text-xs font-normal text-textMuted opacity-60 ml-1"},[e._v(e._s(i.type))])])}),0)]),t("tbody",[e._l(e.tableData.rows,function(i,n){return t("tr",{key:n,staticClass:"hover:bg-white/5"},e._l(e.tableInfo.columns,function(r){return t("td",{key:r.name,staticClass:"px-3 py-1.5 text-gray-300 border-b border-border/30"},[e._v(" "+e._s(e.formatCell(i[r.name]))+" ")])}),0)}),e.tableData.rows&&e.tableData.rows.length===0?t("tr",[t("td",{staticClass:"px-3 py-8 text-center text-textMuted",attrs:{colspan:e.tableInfo.columns?e.tableInfo.columns.length:0}},[e._v(" 表中无数据 ")])]):e._e()],2)])])]):t("div",{staticClass:"flex-1 flex items-center justify-center text-textMuted"},[e._m(1)])])])},Fgt=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"flex border-b border-border text-xs uppercase font-bold text-textMuted"},[e("div",{staticClass:"px-4 py-2 border-b-2 border-accent text-white flex items-center gap-2"},[e("i",{staticClass:"fa-solid fa-database"}),s._v(" Tables ")])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fa-solid fa-database text-6xl mb-4 opacity-20"}),e("p",[s._v("选择表查看数据")])])}],Bgt=en(Ogt,Agt,Fgt,!1,null,null);const Wgt=Bgt.exports,Vgt={name:"AppLayout",computed:{isHome(){return this.$route.path==="/views/app"}}};var Hgt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"app-layout"},[e.isHome?t("header",{staticClass:"app-header"},[e._m(0)]):e._e(),t("main",{staticClass:"app-content"},[t("router-view")],1)])},$gt=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"header-left"},[e("i",{staticClass:"fa-solid fa-robot text-accent"}),e("span",[s._v("TXCode")])])}],zgt=en(Vgt,Hgt,$gt,!1,null,"8ada14ed");const jgt=zgt.exports,Ugt={name:"IndexViewApp",data(){return{sessions:[]}},async created(){await this.loadSessions()},methods:{goTo(s){this.$router.push(s)},async loadSessions(){try{const s=await Yt.getSessions();this.sessions=s.data||[]}catch(s){console.error("加载会话失败:",s)}},goSession(s){this.$router.push({name:"app-ChatViewApp-session",params:{id:s.id}})},async createSession(){try{const s=await Yt.createSession("新会话");this.$router.push({name:"app-ChatViewApp-session",params:{id:s.data.id}})}catch{this.$message.error("创建会话失败")}},formatTime(s){if(!s)return"";const e=new Date(s),i=new Date-e;return i<6e4?"刚刚":i<36e5?Math.floor(i/6e4)+"分钟前":i<864e5?Math.floor(i/36e5)+"小时前":i<6048e5?Math.floor(i/864e5)+"天前":e.toLocaleDateString()}}};var qgt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"index-view"},[e._m(0),t("div",{staticClass:"feature-grid"},[t("div",{staticClass:"feature-card code",on:{click:function(i){return e.goTo("/views/app/ChatViewApp")}}},[t("i",{staticClass:"fa-regular fa-comments"}),t("h3",[e._v("代码对话")]),t("p",[e._v("与 AI 对话开发")])]),t("div",{staticClass:"feature-card workflow",on:{click:function(i){return e.goTo("/views/app/DevWorkflowViewApp")}}},[t("i",{staticClass:"fa-solid fa-laptop-code"}),t("h3",[e._v("软件研发")]),t("p",[e._v("规范研发流程")])]),t("div",{staticClass:"feature-card files",on:{click:function(i){return e.goTo("/views/app/FilesViewApp")}}},[t("i",{staticClass:"fa-solid fa-folder-open"}),t("h3",[e._v("文件管理")]),t("p",[e._v("浏览项目文件")])]),t("div",{staticClass:"feature-card git",on:{click:function(i){return e.goTo("/views/app/GitChangesApp")}}},[t("i",{staticClass:"fa-brands fa-git-alt"}),t("h3",[e._v("Git变更")]),t("p",[e._v("查看代码变更")])])]),t("div",{staticClass:"section-header"},[t("h2",{staticClass:"section-title"},[e._v("最近会话")]),t("a",{staticClass:"section-more",attrs:{href:"javascript:void(0)"},on:{click:function(i){return e.goTo("/views/app/ChatViewApp")}}},[e._v("查看全部")])]),e.sessions.length>0?t("div",{staticClass:"session-list"},e._l(e.sessions.slice(0,5),function(i){return t("div",{key:i.id,staticClass:"session-item",on:{click:function(n){return e.goSession(i)}}},[e._m(1,!0),t("div",{staticClass:"session-info"},[t("h4",[e._v(e._s(i.title||"未命名会话"))]),t("p",[e._v(e._s(e.formatTime(i.updatedAt||i.createTime)))])]),t("div",{staticClass:"session-status"})])}),0):t("div",{staticClass:"empty-state"},[t("i",{staticClass:"fa-regular fa-comment-dots"}),t("p",[e._v("暂无会话记录")]),t("span",{staticClass:"start-btn",on:{click:e.createSession}},[e._v("开始新对话")])])])},Kgt=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"welcome-section"},[e("div",{staticClass:"welcome-icon"},[e("i",{staticClass:"fa-solid fa-wand-magic-sparkles"})]),e("h1",{staticClass:"welcome-title"},[s._v("你好,我是 TXCode")]),e("p",{staticClass:"welcome-subtitle"},[s._v("AI 驱动的软件开发助手")])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"session-icon"},[e("i",{staticClass:"fa-solid fa-robot"})])}],Ggt=en(Ugt,qgt,Kgt,!1,null,"326b6f16");const Ygt=Ggt.exports,Zgt={name:"FilesViewApp",data(){return{projects:[],currentProject:null,browseResult:{current_path:"",parent_path:null,items:[]},loading:!1,contextMenu:{visible:!1,target:null},inputDialog:{visible:!1,title:"",value:"",placeholder:"",type:"",target:null},confirmDialog:{visible:!1,message:"",target:null},fileViewerVisible:!1,editingFileName:"",editingFilePath:"",fileLoading:!1,saving:!1,isBinary:!1,editor:null,originalContent:"",fileIcons:{js:"fa-brands fa-js text-yellow-400",ts:"fa-brands fa-js text-blue-400",html:"fa-brands fa-html5 text-orange-500",css:"fa-brands fa-css3 text-blue-400",json:"fa-solid fa-file-code text-yellow-300",yaml:"fa-solid fa-file-code text-blue-300",yml:"fa-solid fa-file-code text-blue-300",md:"fa-solid fa-file-lines text-gray-400",py:"fa-brands fa-python text-blue-500",vue:"fa-brands fa-vuejs text-green-400",sh:"fa-solid fa-terminal text-green-400",go:"fa-brands fa-golang text-cyan-400"}}},computed:{fileTreeData(){return this.browseResult.items.map(e=>this.transformNode(e)).sort((e,t)=>e.is_directory===t.is_directory?e.name.localeCompare(t.name):e.is_directory?-1:1)},currentDirName(){const s=this.browseResult.current_path;return s?s.split(/[/\\]/).pop()||s:"我的电脑"},hasChanges(){return this.editor?this.editor.getValue()!==this.originalContent:!1},isBinaryFile(){return this.isBinary}},async created(){await this.loadProjects(),await this.browse(""),document.addEventListener("keydown",this.handleKeydown)},beforeDestroy(){document.removeEventListener("keydown",this.handleKeydown),this.editor&&(this.editor.dispose(),this.editor=null)},methods:{async loadProjects(){try{const s=await Yt.getProjects();this.projects=s.data||[];const e=await Yt.getCurrentProject();this.currentProject=e.data||null}catch(s){console.error("Load projects failed:",s)}},async handleProjectChange(s){try{await Yt.setCurrentProject(s);const e=this.projects.find(t=>t.id===s);e&&(this.currentProject=e),location.reload()}catch(e){this.$message.error("切换项目失败: "+e.message)}},async browse(s){this.loading=!0;try{const e=await Yt.browseFilesystem(s);this.browseResult=e.data}catch(e){console.error("Browse failed:",e)}finally{this.loading=!1}},transformNode(s){return{name:s.name,path:s.path,is_directory:s.is_directory,is_drive:s.is_drive||!1,size:s.size,is_binary:s.is_binary||!1}},handleItemClick(s){s.is_directory?this.browse(s.path):this.openFileViewer(s)},toggleMenu(){this.$message.info("长安文件可进行更多操作")},async openFileItem(){this.hideContextMenu(),this.contextMenu.target&&this.openFileViewer(this.contextMenu.target)},goBack(){this.$router.back()},goUp(){if(!this.browseResult.parent_path&&this.browseResult.parent_path!=="")return;const s=this.browseResult.parent_path===""?"":this.browseResult.parent_path;this.browse(s)},async openFileViewer(s){var n,r;if(this.fileViewerVisible=!0,this.editingFileName=s.name,this.editingFilePath=s.path,this.fileLoading=!0,this.isBinary=s.is_binary||!1,this.editor=null,this.isBinary){this.fileLoading=!1;return}let e="";try{const o=await Yt.getFileContent(s.path);this.isBinary=((n=o.data)==null?void 0:n.is_binary)||!1,e=((r=o.data)==null?void 0:r.content)||""}catch(o){console.error("Load file failed:",o),this.fileLoading=!1;return}if(this.fileLoading=!1,this.isBinary||(await this.$nextTick(),!this.$refs.editorContainer))return;this.editor=$b.create(this.$refs.editorContainer,{value:"",language:"plaintext",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:16,fontFamily:'Consolas, Monaco, "Courier New", monospace',lineNumbers:"on",roundedSelection:!1,scrollbar:{useShadows:!1,vertical:"auto",horizontal:"auto"}}),this.editor.onDidChangeModelContent(()=>{this.$forceUpdate()}),this.editor.addCommand(l3.CtrlCmd|a3.KeyS,()=>{this.saveFile()});const t=this.getLanguageFromFilename(s.name),i=$b.createModel(e,t);this.editor.setModel(i),this.originalContent=e},closeFileViewer(){this.editor&&(this.editor.dispose(),this.editor=null),this.fileViewerVisible=!1},async saveFile(){if(!(!this.editor||this.saving)){this.saving=!0;try{const s=this.editor.getValue();await Yt.writeFile(this.editingFilePath,s),this.originalContent=s,this.$message.success("已保存")}catch(s){console.error("Save failed:",s),this.$message.error("保存失败")}finally{this.saving=!1}}},initEditor(){this.editor||!this.$refs.editorContainer||(this.editor=$b.create(this.$refs.editorContainer,{value:"",language:"plaintext",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:16,fontFamily:'Consolas, Monaco, "Courier New", monospace',lineNumbers:"on"}),this.editor.addCommand(l3.CtrlCmd|a3.KeyS,()=>{this.saveFile()}))},showContextMenu(s,e){s.stopPropagation(),this.contextMenu={visible:!0,target:e}},hideContextMenu(){this.contextMenu.visible=!1},copyPath(){this.hideContextMenu(),this.contextMenu.target&&(navigator.clipboard.writeText(this.contextMenu.target.path),this.$message.success("路径已复制"))},createNewFile(){this.hideContextMenu(),this.inputDialog={visible:!0,title:"新建文件",value:"",placeholder:"输入文件名",type:"file",target:this.contextMenu.target},this.$nextTick(()=>{var s;(s=this.$refs.dialogInput)==null||s.focus()})},createNewFolder(){this.hideContextMenu(),this.inputDialog={visible:!0,title:"新建文件夹",value:"",placeholder:"输入文件夹名",type:"folder",target:this.contextMenu.target},this.$nextTick(()=>{var s;(s=this.$refs.dialogInput)==null||s.focus()})},renameItem(){this.hideContextMenu(),this.inputDialog={visible:!0,title:"重命名",value:this.contextMenu.target.name,placeholder:"输入新名称",type:"rename",target:this.contextMenu.target},this.$nextTick(()=>{var s,e;(s=this.$refs.dialogInput)==null||s.focus(),(e=this.$refs.dialogInput)==null||e.select()})},async confirmInput(){const{type:s,value:e,target:t}=this.inputDialog;if(!e.trim()){this.cancelInput();return}try{const i=t.path.includes("\\")?"\\":"/";if(s==="file"){const n=t.path+i+e.trim();await Yt.writeFile(n,"")}else if(s==="folder"){const n=t.path+i+e.trim();await Yt.createDirectory(n)}else if(s==="rename"){const r=t.path.substring(0,t.path.lastIndexOf(i))+i+e.trim();await Yt.renameFile(t.path,r)}this.browse(this.browseResult.current_path)}catch(i){console.error("Operation failed:",i),this.$message.error("操作失败")}this.inputDialog.visible=!1},cancelInput(){this.inputDialog.visible=!1},deleteItem(){this.hideContextMenu(),this.confirmDialog={visible:!0,message:`确定要删除 "${this.contextMenu.target.name}" 吗?`,target:this.contextMenu.target}},cancelConfirm(){this.confirmDialog.visible=!1},async confirmDelete(){try{await Yt.deleteFile(this.confirmDialog.target.path),this.$message.success("删除成功"),this.browse(this.browseResult.current_path)}catch(s){console.error("Delete failed:",s),this.$message.error("删除失败")}this.confirmDialog.visible=!1},handleKeydown(s){s.ctrlKey&&s.key==="s"&&this.fileViewerVisible&&(s.preventDefault(),this.saveFile())},getItemIcon(s){if(s.is_directory)return"fa-solid fa-folder text-blue-400";const e=s.name.split(".").pop().toLowerCase(),t=s.name.toLowerCase();return t==="dockerfile"?"fa-brands fa-docker text-blue-400":t===".gitignore"?"fa-brands fa-git text-red-400":this.fileIcons[e]||"fa-solid fa-file text-gray-400"},getLanguageFromFilename(s){const e=s.split(".").pop().toLowerCase();return{js:"javascript",ts:"typescript",html:"html",css:"css",vue:"html",py:"python",md:"markdown",json:"json",yaml:"yaml",yml:"yaml",xml:"xml",sql:"sql",sh:"shell",go:"go",rs:"rust"}[e]||"plaintext"}}};var Xgt=function(){var i,n,r,o;var e=this,t=e._self._c;return t("div",{staticClass:"h-full flex flex-col bg-[#1e1e1e]"},[t("div",{staticClass:"bg-sidebar border-b border-border px-4 py-3 flex items-center justify-between shrink-0"},[t("div",{staticClass:"flex items-center gap-2"},[t("button",{staticClass:"p-2 text-textMuted hover:text-white",attrs:{title:"返回"},on:{click:e.goBack}},[t("i",{staticClass:"fa-solid fa-chevron-left"})]),t("button",{staticClass:"p-2 text-textMuted hover:text-white disabled:opacity-30",attrs:{disabled:!e.browseResult.parent_path&&e.browseResult.parent_path!=="",title:"上级目录"},on:{click:e.goUp}},[t("i",{staticClass:"fa-solid fa-arrow-up"})])]),t("div",{staticClass:"flex items-center gap-2"},[e.projects.length>0?t("el-dropdown",{attrs:{trigger:"click"},on:{command:e.handleProjectChange}},[t("span",{staticClass:"text-sm text-white cursor-pointer hover:text-accent"},[e._v(" "+e._s(((i=e.currentProject)==null?void 0:i.name)||"选择项目")+" "),t("i",{staticClass:"fa-solid fa-chevron-down ml-1 text-xs"})]),t("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.projects,function(a){var l;return t("el-dropdown-item",{key:a.id,attrs:{command:a.id}},[t("span",{class:a.id===((l=e.currentProject)==null?void 0:l.id)?"text-accent":""},[e._v(e._s(a.name))])])}),1)],1):e._e()],1),t("button",{staticClass:"p-2 text-textMuted hover:text-white",on:{click:e.toggleMenu}},[t("i",{staticClass:"fa-solid fa-ellipsis-v"})])]),t("div",{staticClass:"flex-1 overflow-y-auto"},[e.loading?t("div",{staticClass:"flex flex-col items-center justify-center h-full text-textMuted"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin text-2xl mb-2"}),t("span",{staticClass:"text-sm"},[e._v("加载中...")])]):e.fileTreeData.length===0?t("div",{staticClass:"flex flex-col items-center justify-center h-full text-textMuted"},[t("i",{staticClass:"fa-solid fa-folder-open text-4xl mb-2 opacity-30"}),t("span",{staticClass:"text-sm"},[e._v("此目录为空")])]):t("div",{staticClass:"divide-y divide-border"},e._l(e.fileTreeData,function(a){return t("div",{key:a.path,staticClass:"flex items-center px-4 py-3 active:bg-active",on:{click:function(l){return e.handleItemClick(a)}}},[t("i",{staticClass:"text-lg w-8 text-center",class:e.getItemIcon(a)}),t("span",{staticClass:"flex-1 text-sm text-white ml-2 truncate"},[e._v(e._s(a.name))]),a.is_directory?t("i",{staticClass:"fa-solid fa-chevron-right text-textMuted text-xs"}):e._e()])}),0)]),e.contextMenu.visible?t("div",{staticClass:"fixed inset-0 bg-black/50 z-50",on:{click:e.hideContextMenu}},[t("div",{staticClass:"absolute bottom-0 left-0 right-0 bg-sidebar rounded-t-xl p-4",on:{click:function(a){a.stopPropagation()}}},[t("div",{staticClass:"w-12 h-1 bg-gray-500 rounded-full mx-auto mb-4"}),t("div",{staticClass:"space-y-1"},[(n=e.contextMenu.target)!=null&&n.is_directory?t("button",{staticClass:"w-full flex items-center gap-3 px-4 py-3 text-white text-sm active:bg-active rounded-lg",on:{click:e.createNewFile}},[t("i",{staticClass:"fa-solid fa-file-lines w-5"}),e._v(" 新建文件 ")]):e._e(),(r=e.contextMenu.target)!=null&&r.is_directory?t("button",{staticClass:"w-full flex items-center gap-3 px-4 py-3 text-white text-sm active:bg-active rounded-lg",on:{click:e.createNewFolder}},[t("i",{staticClass:"fa-solid fa-folder-plus w-5"}),e._v(" 新建文件夹 ")]):e._e(),t("button",{staticClass:"w-full flex items-center gap-3 px-4 py-3 text-white text-sm active:bg-active rounded-lg",on:{click:e.copyPath}},[t("i",{staticClass:"fa-solid fa-copy w-5"}),e._v(" 复制路径 ")]),(o=e.contextMenu.target)!=null&&o.is_directory?e._e():t("button",{staticClass:"w-full flex items-center gap-3 px-4 py-3 text-white text-sm active:bg-active rounded-lg",on:{click:e.openFileItem}},[t("i",{staticClass:"fa-solid fa-folder-open w-5"}),e._v(" 打开文件 ")]),t("button",{staticClass:"w-full flex items-center gap-3 px-4 py-3 text-white text-sm active:bg-active rounded-lg",on:{click:e.renameItem}},[t("i",{staticClass:"fa-solid fa-pen w-5"}),e._v(" 重命名 ")]),t("button",{staticClass:"w-full flex items-center gap-3 px-4 py-3 text-red-400 text-sm active:bg-active rounded-lg",on:{click:e.deleteItem}},[t("i",{staticClass:"fa-solid fa-trash w-5"}),e._v(" 删除 ")])])])]):e._e(),e.inputDialog.visible?t("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",on:{click:function(a){return a.target!==a.currentTarget?null:e.cancelInput.apply(null,arguments)}}},[t("div",{staticClass:"w-full max-w-sm bg-sidebar border border-border rounded-xl p-4"},[t("p",{staticClass:"text-white text-base mb-4"},[e._v(e._s(e.inputDialog.title))]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.inputDialog.value,expression:"inputDialog.value"}],ref:"dialogInput",staticClass:"w-full px-4 py-3 bg-[#1e1e1e] border border-border rounded-lg text-white text-sm focus:outline-none focus:border-accent",attrs:{placeholder:e.inputDialog.placeholder},domProps:{value:e.inputDialog.value},on:{keyup:[function(a){return!a.type.indexOf("key")&&e._k(a.keyCode,"enter",13,a.key,"Enter")?null:e.confirmInput.apply(null,arguments)},function(a){return!a.type.indexOf("key")&&e._k(a.keyCode,"escape",void 0,a.key,void 0)?null:e.cancelInput.apply(null,arguments)}],input:function(a){a.target.composing||e.$set(e.inputDialog,"value",a.target.value)}}}),t("div",{staticClass:"flex gap-3 mt-4"},[t("button",{staticClass:"flex-1 py-3 text-textMuted text-sm rounded-lg",on:{click:e.cancelInput}},[e._v("取消")]),t("button",{staticClass:"flex-1 py-3 bg-accent text-white text-sm rounded-lg",on:{click:e.confirmInput}},[e._v("确定")])])])]):e._e(),e.fileViewerVisible?t("div",{staticClass:"fixed inset-0 bg-black/50 z-50",on:{click:function(a){return a.target!==a.currentTarget?null:e.closeFileViewer.apply(null,arguments)}}},[t("div",{staticClass:"absolute bottom-0 left-0 right-0 bg-[#1e1e1e] rounded-t-2xl flex flex-col",staticStyle:{height:"85vh"}},[e._m(0),t("div",{staticClass:"bg-sidebar border-b border-border px-4 py-2 flex items-center justify-between shrink-0"},[t("span",{staticClass:"text-sm text-white truncate"},[e._v(e._s(e.editingFileName))]),t("div",{staticClass:"flex items-center gap-2"},[t("button",{staticClass:"p-2 text-accent disabled:opacity-50",attrs:{disabled:!e.hasChanges||e.saving,title:"保存"},on:{click:e.saveFile}},[e.saving?t("i",{staticClass:"fa-solid fa-spinner fa-spin"}):t("i",{staticClass:"fa-solid fa-save"})]),t("button",{staticClass:"p-2 text-textMuted hover:text-white",attrs:{title:"关闭"},on:{click:e.closeFileViewer}},[t("i",{staticClass:"fa-solid fa-times"})])])]),t("div",{staticClass:"flex-1 overflow-hidden"},[e.fileLoading?t("div",{staticClass:"flex items-center justify-center h-full text-textMuted"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.isBinary?t("div",{staticClass:"flex items-center justify-center h-full text-textMuted"},[e._m(1)]):t("div",{ref:"editorContainer",staticClass:"w-full h-full monaco-editor-container"})]),e.hasChanges&&!e.isBinary?t("div",{staticClass:"bg-yellow-600/20 border-t border-yellow-600/30 px-4 py-2 text-yellow-500 text-sm text-center shrink-0"},[e._v(" 文件已修改,Ctrl+S 保存 ")]):e._e()])]):e._e(),e.confirmDialog.visible?t("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4"},[t("div",{staticClass:"w-full max-w-sm bg-sidebar border border-border rounded-xl p-4"},[t("p",{staticClass:"text-white text-base mb-4"},[e._v(e._s(e.confirmDialog.message))]),t("div",{staticClass:"flex gap-3"},[t("button",{staticClass:"flex-1 py-3 text-textMuted text-sm rounded-lg",on:{click:e.cancelConfirm}},[e._v("取消")]),t("button",{staticClass:"flex-1 py-3 bg-red-500 text-white text-sm rounded-lg",on:{click:e.confirmDelete}},[e._v("删除")])])])]):e._e()])},Qgt=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"flex justify-center pt-3 pb-1 shrink-0"},[e("div",{staticClass:"w-10 h-1 bg-gray-500 rounded-full"})])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fa-solid fa-file text-4xl mb-4 opacity-30"}),e("p",[s._v("二进制文件无法预览")])])}],Jgt=en(Zgt,Xgt,Qgt,!1,null,"1a0ed99e");const ept=Jgt.exports,tpt={name:"FileTreeNode",props:{node:{type:Object,required:!0},selectedPath:{type:String,default:""}},data(){return{loading:!1}},methods:{async toggleExpand(){this.node.is_directory&&(!this.node.expanded&&this.node.children.length===0?(this.node.loading=!0,this.$emit("load-children",this.node)):this.node.expanded=!this.node.expanded)},handleClick(){this.node.is_directory?this.toggleExpand():this.$emit("select-node",this.node)},handleLoadChildren(s){this.$emit("load-children",s)},handleSelectNode(s){this.$emit("select-node",s)},getFileIcon(s,e){if(e)return"fa-solid fa-folder";const t=s.split(".").pop().toLowerCase(),i=s.toLowerCase(),n={js:"fa-brands fa-js",jsx:"fa-brands fa-react",ts:"fa-brands fa-js",tsx:"fa-brands fa-react",vue:"fa-brands fa-vuejs",py:"fa-brands fa-python",html:"fa-brands fa-html5",htm:"fa-brands fa-html5",css:"fa-brands fa-css3",scss:"fa-brands fa-sass",json:"fa-solid fa-file-code",yaml:"fa-solid fa-file-code",yml:"fa-solid fa-file-code",md:"fa-solid fa-file-lines",sql:"fa-solid fa-database",sh:"fa-solid fa-terminal",go:"fa-brands fa-golang",java:"fa-brands fa-java",dockerfile:"fa-brands fa-docker"};return i==="dockerfile"?"fa-brands fa-docker":i===".gitignore"?"fa-brands fa-git":n[t]||"fa-solid fa-file"}}};var ipt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"file-tree-node"},[t("div",{staticClass:"node-row",class:{selected:e.selectedPath===e.node.path},on:{click:e.handleClick}},[e.node.is_directory?t("span",{staticClass:"expand-icon",on:{click:function(i){return i.stopPropagation(),e.toggleExpand.apply(null,arguments)}}},[e.node.loading?t("i",{staticClass:"fa-solid fa-spinner fa-spin"}):e.node.expanded?t("i",{staticClass:"fa-solid fa-chevron-down"}):t("i",{staticClass:"fa-solid fa-chevron-right"})]):t("span",{staticClass:"expand-icon placeholder"}),t("span",{staticClass:"node-icon"},[t("i",{class:e.getFileIcon(e.node.name,e.node.is_directory)})]),t("span",{staticClass:"node-name"},[e._v(e._s(e.node.name))])]),e.node.is_directory&&e.node.expanded&&e.node.children&&e.node.children.length>0?t("div",{staticClass:"node-children"},e._l(e.node.children,function(i){return t("FileTreeNode",{key:i.path,attrs:{node:i,"selected-path":e.selectedPath},on:{"load-children":e.handleLoadChildren,"select-node":e.handleSelectNode}})}),1):e._e()])},npt=[],spt=en(tpt,ipt,npt,!1,null,"95a2c18b");const rpt=spt.exports,opt={name:"FileSelectDrawer",components:{FileTreeNode:rpt},props:{visible:{type:Boolean,default:!1}},data(){return{currentPath:"",parentPath:null,fileTreeData:[],selectedPath:"",loading:!1}},computed:{canGoUp(){return this.parentPath!==null&&this.parentPath!==void 0}},watch:{visible(s){s?this.loadFileTree(""):this.reset()}},methods:{reset(){this.currentPath="",this.parentPath=null,this.fileTreeData=[],this.selectedPath="",this.loading=!1},async loadFileTree(s=""){var e,t,i;this.loading=!0;try{const n=await Yt.browseFilesystem(s);this.currentPath=((e=n.data)==null?void 0:e.current_path)||s,this.parentPath=(t=n.data)==null?void 0:t.parent_path;const r=(((i=n.data)==null?void 0:i.items)||[]).map(o=>this.transformNode(o));r.sort((o,a)=>o.is_directory===a.is_directory?o.name.localeCompare(a.name):o.is_directory?-1:1),this.fileTreeData=r}catch(n){console.error("加载文件树失败:",n),this.fileTreeData=[]}finally{this.loading=!1}},transformNode(s){return{name:s.name,path:s.path,is_directory:s.is_directory,has_children:s.is_directory,expanded:!1,children:[],loading:!1}},async onLoadChildren(s){var e;try{const i=(((e=(await Yt.browseFilesystem(s.path)).data)==null?void 0:e.items)||[]).map(n=>this.transformNode(n));i.sort((n,r)=>n.is_directory===r.is_directory?n.name.localeCompare(r.name):n.is_directory?-1:1),s.children=i,s.expanded=!0}catch(t){console.error("加载子目录失败:",t),s.children=[],s.expanded=!0}finally{s.loading=!1}},onSelectNode(s){this.selectedPath=s.path},goUp(){this.parentPath!==null&&this.parentPath!==void 0&&this.loadFileTree(this.parentPath===""?"":this.parentPath)},goHome(){this.loadFileTree("")},handleConfirm(){this.selectedPath&&(this.$emit("select",this.selectedPath),this.$emit("close"))},handleClose(){this.$emit("close")},getFileIcon(s,e){if(e)return"fa-solid fa-folder";const t=s.split(".").pop().toLowerCase(),i=s.toLowerCase(),n={js:"fa-brands fa-js",jsx:"fa-brands fa-react",ts:"fa-brands fa-js",tsx:"fa-brands fa-react",vue:"fa-brands fa-vuejs",py:"fa-brands fa-python",html:"fa-brands fa-html5",htm:"fa-brands fa-html5",css:"fa-brands fa-css3",scss:"fa-brands fa-sass",json:"fa-solid fa-file-code",yaml:"fa-solid fa-file-code",yml:"fa-solid fa-file-code",md:"fa-solid fa-file-lines",sql:"fa-solid fa-database",sh:"fa-solid fa-terminal",go:"fa-brands fa-golang",java:"fa-brands fa-java",dockerfile:"fa-brands fa-docker"};return i==="dockerfile"?"fa-brands fa-docker":i===".gitignore"?"fa-brands fa-git":n[t]||"fa-solid fa-file"}}};var apt=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"drawer-overlay",class:{show:e.visible},on:{click:e.handleClose}}),t("div",{staticClass:"file-drawer",class:{show:e.visible}},[t("div",{staticClass:"drawer-header"},[t("span",{staticClass:"drawer-title",staticStyle:{color:"#f4f4f5"}},[e._v("选择文件")]),t("button",{staticClass:"drawer-close",on:{click:e.handleClose}},[t("i",{staticClass:"fa-solid fa-xmark"})])]),t("div",{staticClass:"file-toolbar"},[t("button",{staticClass:"toolbar-btn",attrs:{disabled:!e.canGoUp},on:{click:e.goUp}},[t("i",{staticClass:"fa-solid fa-arrow-up"})]),t("button",{staticClass:"toolbar-btn",on:{click:e.goHome}},[t("i",{staticClass:"fa-solid fa-home"})]),t("div",{staticClass:"file-path"},[e._v(e._s(e.currentPath||"/"))])]),t("div",{staticClass:"file-tree-container"},[e.loading?t("div",{staticClass:"file-loading"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin"}),e._v(" 加载中... ")]):e.fileTreeData.length===0?t("div",{staticClass:"file-empty"},[e._v(" 此目录为空 ")]):e._l(e.fileTreeData,function(i){return t("FileTreeNode",{key:i.path,attrs:{node:i,"selected-path":e.selectedPath},on:{"load-children":e.onLoadChildren,"select-node":e.onSelectNode}})})],2),t("div",{staticClass:"drawer-footer"},[t("div",{staticClass:"selected-path"},[e._v(e._s(e.selectedPath||"未选择"))]),t("button",{staticClass:"confirm-btn",attrs:{disabled:!e.selectedPath},on:{click:e.handleConfirm}},[e._v("选择")])])])])},lpt=[],cpt=en(opt,apt,lpt,!1,null,"bde2b0c6");const dpt=cpt.exports,upt={name:"ChatViewApp",components:{FileSelectDrawer:dpt},data(){return{sessions:[],currentSessionId:null,currentSession:null,logItems:[],inputMessage:"",isProcessing:!1,modelName:"",promptTokens:0,showSessionDrawer:!1,showModelDrawer:!1,showCommandDrawer:!1,showFileDrawer:!1,searchKeyword:"",models:[],logSeq:0,wsUnsubscribe:null}},computed:{filteredSessions(){if(!this.searchKeyword)return this.sessions;const s=this.searchKeyword.toLowerCase();return this.sessions.filter(e=>(e.title||"").toLowerCase().includes(s))}},async created(){this.initGlobalWs(),await this.loadSessions(),await this.loadModels(),await this.loadDefaultModel();const s=this.$route.params.id;if(s){const e=this.sessions.find(t=>t.id===s);e&&await this.selectSession(e,!1)}},activated(){this.currentSessionId&&this.subscribeSession()},deactivated(){this.wsUnsubscribe&&(this.wsUnsubscribe(),this.wsUnsubscribe=null)},methods:{goBack(){this.$router.push("/views/app")},initGlobalWs(){Cd.init()},closeAllDrawers(){this.showSessionDrawer=!1,this.showModelDrawer=!1,this.showCommandDrawer=!1,this.showFileDrawer=!1},renderMarkdown(s){return s?Gn(s):""},getTodoStatusIcon(s){return{completed:"✅",in_progress:"🔄",pending:"⬜",cancelled:"❌"}[s]||"⬜"},getToolCallName(s){var e;return((e=s==null?void 0:s.function)==null?void 0:e.name)||"unknown"},formatToolArgs(s){var e,t,i;try{const n=JSON.parse(((e=s==null?void 0:s.function)==null?void 0:e.arguments)||"{}");return n.file_path?n.file_path:n.command?n.command:((t=s==null?void 0:s.function)==null?void 0:t.arguments)||""}catch{return((i=s==null?void 0:s.function)==null?void 0:i.arguments)||""}},async loadSessions(){try{const s=await ive();this.sessions=s.data||[]}catch(s){console.error("加载会话失败:",s)}},async loadModels(){try{const s=await Yt.getModels();this.models=s.data||[]}catch(s){console.error("加载模型失败:",s)}},async loadDefaultModel(){var s;try{const e=await Yt.getConfig("defaultModel");(s=e.data)!=null&&s.value&&(this.modelName=e.data.value)}catch{this.modelName="gpt-4o"}},async selectSession(s,e=!0){this.wsUnsubscribe&&(this.wsUnsubscribe(),this.wsUnsubscribe=null),this.currentSession=s,this.currentSessionId=s.id,this.logItems=[],this.isProcessing=s.status==="processing",e&&this.$route.params.id!==s.id&&this.$router.push({name:"app-ChatViewApp-session",params:{id:s.id}}).catch(()=>{}),await this.loadMessages(),this.subscribeSession(),this.showSessionDrawer=!1},async loadMessages(){try{const s=await sve(this.currentSessionId);this.logItems=(s.data||[]).map(e=>e.type==="think"?{type:"think",content:e.content||"",_id:`log-${++this.logSeq}`}:e.type==="step"?{type:"step",thought:e.thought,toolCalls:e.toolCalls||[],success:e.success,_id:`log-${++this.logSeq}`}:e.type==="chat"?{type:"chat",content:e.content,_id:`log-${++this.logSeq}`}:e.type==="todos"?{type:"todos",todos:e.todos||[],_id:`log-${++this.logSeq}`}:{type:"system",content:String(e),_id:`log-${++this.logSeq}`}),this.scrollToBottom()}catch(s){console.error("加载消息失败:",s)}},subscribeSession(){this.currentSessionId&&(this.wsUnsubscribe&&this.wsUnsubscribe(),this.wsUnsubscribe=Cd.subscribe(this.currentSessionId,{running_sessions:s=>{const e=(s==null?void 0:s.runningSessionIds)||[];this.updateSessionStatus(e)},todos:s=>{this.logItems.push({type:"todos",todos:s.todos,_id:`log-${++this.logSeq}`}),this.scrollToBottom()},session:s=>{s!=null&&s.sessionId&&!this.currentSessionId&&(this.currentSessionId=s.sessionId)},step:s=>{var e;this.logItems.push({type:"step",thought:s==null?void 0:s.thought,toolCalls:(s==null?void 0:s.toolCalls)||[],success:s==null?void 0:s.success,_id:`log-${++this.logSeq}`}),(e=s==null?void 0:s.usage)!=null&&e.promptTokens&&(this.promptTokens=s.usage.promptTokens),this.scrollToBottom()},compact:s=>{this.logItems.push({type:"system",content:`【压缩完成】${s.summary||""}`,_id:`log-${++this.logSeq}`}),this.loadSessions(),this.loadMessages()},done:s=>{var e;this.isProcessing=!1,s!=null&&s.modelName&&(this.modelName=s.modelName),(e=s==null?void 0:s.usage)!=null&&e.promptTokens&&(this.promptTokens=s.usage.promptTokens),s!=null&&s.response&&this.logItems.push({type:"think",content:s.response,_id:`log-${++this.logSeq}`}),this.loadSessions(),this.scrollToBottom()},stopped:()=>{this.isProcessing=!1,this.logItems.push({type:"think",content:"【已停止】",_id:`log-${++this.logSeq}`}),this.scrollToBottom()},error:s=>{this.isProcessing=!1,this.$message.error((s==null?void 0:s.error)||"发生错误")}}))},updateSessionStatus(s){new Set(s||[]).has(this.currentSessionId)?this.isProcessing=!0:this.isProcessing=!1},async createSession(){try{const s=await nve("新会话");this.sessions.unshift(s.data),await this.selectSession(s.data)}catch(s){this.$message.error("创建会话失败: "+s.message)}},sendMessage(){if(!this.inputMessage.trim()||this.isProcessing)return;if(!this.currentSessionId){this.createSession().then(()=>this.sendMessage());return}const s=this.inputMessage.trim();this.inputMessage="",this.isProcessing=!0,this.logItems.push({type:"chat",content:s,_id:`log-${++this.logSeq}`}),this.scrollToBottom(),Cd.send("chat",{message:s,sessionId:this.currentSessionId,modelName:this.modelName||void 0})},stopGeneration(){this.currentSessionId&&(this.isProcessing=!1,Cd.send("stop",{sessionId:this.currentSessionId}))},appendCommand(s){var e;this.inputMessage=s+" ",(e=this.$refs.inputField)==null||e.focus()},openFileSelect(){this.showFileDrawer=!0},onFileSelected(s){var e;this.inputMessage=this.inputMessage+s+" ",this.showFileDrawer=!1,(e=this.$refs.inputField)==null||e.focus()},selectModel(s){const e=s.name.split("/");this.modelName=e.length>2?e.slice(1).join("/"):s.name,Yt.setConfig("defaultModel",this.modelName),this.showModelDrawer=!1},formatTime(s){if(!s)return"";const e=new Date(s),i=new Date-e;return i<6e4?"刚刚":i<36e5?Math.floor(i/6e4)+"分钟前":i<864e5?"今天 "+e.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}):i<6048e5?Math.floor(i/864e5)+"天前":e.toLocaleDateString()},scrollToBottom(){this.$nextTick(()=>{this.$refs.chatArea&&(this.$refs.chatArea.scrollTop=this.$refs.chatArea.scrollHeight)})}}};var hpt=function(){var i;var e=this,t=e._self._c;return t("div",{staticClass:"app-container"},[t("header",{staticClass:"header"},[t("a",{staticClass:"header-back",attrs:{href:"#"},on:{click:function(n){return n.preventDefault(),e.goBack.apply(null,arguments)}}},[t("i",{staticClass:"fa-solid fa-chevron-left"})]),t("div",{staticClass:"session-switch-btn",on:{click:function(n){e.showSessionDrawer=!0}}},[t("i",{staticClass:"fa-solid fa-comments"}),t("span",{staticClass:"title"},[e._v(e._s(((i=e.currentSession)==null?void 0:i.title)||"新会话"))]),t("i",{staticClass:"fa-solid fa-chevron-down arrow"})]),t("div",{staticClass:"header-actions"},[t("a",{staticClass:"header-btn",attrs:{href:"#",title:"命令"},on:{click:function(n){n.preventDefault(),e.showCommandDrawer=!0}}},[t("i",{staticClass:"fa-solid fa-terminal"})])])]),t("div",{staticClass:"model-selector"},[t("span",[e._v("模型")]),t("span",{staticClass:"model-name",on:{click:function(n){e.showModelDrawer=!0}}},[e._v(e._s(e.modelName||"gpt-4o"))]),t("span",{staticClass:"model-change",staticStyle:{color:"var(--accent)","font-size":"12px"},on:{click:function(n){e.showModelDrawer=!0}}},[e._v("切换")])]),t("div",{ref:"chatArea",staticClass:"chat-area"},[e.logItems.length===0?t("div",{staticClass:"empty-state"},[e._m(0),t("div",{staticClass:"empty-title"},[e._v("开始对话")]),t("div",{staticClass:"empty-desc"},[e._v("选择或创建会话开始对话")])]):e._e(),e._l(e.logItems,function(n,r){return[n.type==="chat"?[t("div",{staticClass:"message user"},[t("div",{staticClass:"message-bubble"},[e._v(e._s(n.content))])])]:n.type==="think"?[t("div",{staticClass:"message assistant"},[t("div",{staticClass:"message-bubble",domProps:{innerHTML:e._s(e.renderMarkdown(n.content))}})])]:n.type==="todos"?[t("div",{staticClass:"message assistant"},[t("div",{staticClass:"todo-list"},e._l(n.todos,function(o,a){return t("div",{key:a,staticClass:"todo-item"},[t("span",{staticClass:"todo-status"},[e._v(e._s(e.getTodoStatusIcon(o.status)))]),t("span",[e._v(e._s(o.name))])])}),0)])]:n.type==="step"?[n.thought?t("div",{staticClass:"message assistant"},[t("div",{staticClass:"message-bubble",domProps:{innerHTML:e._s(e.renderMarkdown(n.thought))}})]):e._e(),e._l(n.toolCalls,function(o,a){return t("div",{key:"tc-"+a,staticClass:"tool-log",class:n.success!==!1?"tool-success":"tool-fail"},[t("span",[e._v(e._s(n.success!==!1?"✓":"✗"))]),t("span",{staticClass:"tool-name"},[e._v(e._s(e.getToolCallName(o)))]),t("span",{staticClass:"tool-args"},[e._v(e._s(e.formatToolArgs(o)))])])})]:n.type==="system"?[t("div",{staticClass:"message assistant"},[t("div",{staticClass:"message-bubble"},[e._v(e._s(n.content))])])]:e._e()]}),e.isProcessing?t("div",{staticClass:"message assistant thinking"},[t("div",{staticClass:"message-bubble"},[e._v("思考中...")])]):e._e()],2),t("div",{staticClass:"input-area"},[t("div",{staticClass:"input-container"},[t("div",{staticClass:"input-wrapper"},[t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.inputMessage,expression:"inputMessage"}],ref:"inputField",staticClass:"input-field",attrs:{placeholder:"输入消息... (Enter 发送)"},domProps:{value:e.inputMessage},on:{keydown:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")||n.ctrlKey||n.shiftKey||n.altKey||n.metaKey?null:(n.preventDefault(),e.sendMessage.apply(null,arguments))},input:function(n){n.target.composing||(e.inputMessage=n.target.value)}}})]),t("button",{staticClass:"send-btn",class:{"stop-btn":e.isProcessing},attrs:{disabled:!e.inputMessage.trim()&&!e.isProcessing},on:{click:function(n){e.isProcessing?e.stopGeneration():e.sendMessage()}}},[t("i",{class:e.isProcessing?"fa-solid fa-stop":"fa-solid fa-paper-plane"})])]),t("div",{staticClass:"command-quick"},[t("div",{staticClass:"command-chip",on:{click:function(n){return e.appendCommand("/compact")}}},[t("i",{staticClass:"fa-solid fa-compress-alt"}),e._v(" 压缩会话 ")]),t("div",{staticClass:"command-chip",on:{click:function(n){e.showFileDrawer=!0}}},[t("i",{staticClass:"fa-solid fa-file-circle-plus"}),e._v(" 选择文件 ")])])]),t("div",{staticClass:"status-bar"},[t("div",{staticClass:"status-indicator"},[t("span",{staticClass:"status-dot",class:{processing:e.isProcessing}}),t("span",{class:{"status-processing":e.isProcessing,"status-ready":!e.isProcessing}},[e._v(e._s(e.isProcessing?"处理中...":"就绪"))])]),t("span",[e._v("Token: "+e._s(e.promptTokens||0))])]),t("div",{staticClass:"drawer-overlay",class:{show:e.showSessionDrawer||e.showModelDrawer||e.showCommandDrawer},on:{click:e.closeAllDrawers}}),t("FileSelectDrawer",{attrs:{visible:e.showFileDrawer},on:{select:e.onFileSelected,close:function(n){e.showFileDrawer=!1}}}),t("div",{staticClass:"session-drawer",class:{show:e.showSessionDrawer}},[t("div",{staticClass:"drawer-header"},[t("span",{staticClass:"drawer-title",staticStyle:{color:"var(--text-primary, #f4f4f5)"}},[e._v("选择会话")]),t("button",{staticClass:"drawer-close",on:{click:function(n){e.showSessionDrawer=!1}}},[t("i",{staticClass:"fa-solid fa-xmark"})])]),t("div",{staticClass:"drawer-search"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.searchKeyword,expression:"searchKeyword"}],staticClass:"search-input",attrs:{type:"text",placeholder:"搜索会话..."},domProps:{value:e.searchKeyword},on:{input:function(n){n.target.composing||(e.searchKeyword=n.target.value)}}})]),t("div",{staticClass:"session-list"},e._l(e.filteredSessions,function(n){return t("div",{key:n.id,staticClass:"session-list-item",class:{active:n.id===e.currentSessionId},on:{click:function(r){return e.selectSession(n)}}},[e._m(1,!0),t("div",{staticClass:"session-list-info"},[t("div",{staticClass:"session-list-title"},[e._v(e._s(n.title||"未命名会话"))]),t("div",{staticClass:"session-list-meta"},[e._v(e._s(e.formatTime(n.updatedAt||n.createTime)))])]),t("div",{staticClass:"session-list-status",class:{processing:n.status==="processing"}})])}),0),t("div",{staticClass:"drawer-footer"},[t("button",{staticClass:"new-session-btn",on:{click:e.createSession}},[t("i",{staticClass:"fa-solid fa-plus"}),e._v(" 新建会话 ")])])]),t("div",{staticClass:"session-drawer",class:{show:e.showModelDrawer}},[t("div",{staticClass:"drawer-header"},[t("span",{staticClass:"drawer-title",staticStyle:{color:"var(--text-primary, #f4f4f5)"}},[e._v("选择模型")]),t("button",{staticClass:"drawer-close",on:{click:function(n){e.showModelDrawer=!1}}},[t("i",{staticClass:"fa-solid fa-xmark"})])]),t("div",{staticClass:"command-list"},e._l(e.models,function(n){return t("div",{key:n.id,staticClass:"command-item",class:{active:n.name===e.modelName},on:{click:function(r){return e.selectModel(n)}}},[e._m(2,!0),t("div",{staticClass:"command-info"},[t("div",{staticClass:"command-name"},[e._v(e._s(n.name))]),t("div",{staticClass:"command-desc"},[e._v(e._s(n.provider||"默认"))])])])}),0)]),t("div",{staticClass:"command-drawer",class:{show:e.showCommandDrawer}},[t("div",{staticClass:"drawer-header"},[t("span",{staticClass:"drawer-title",staticStyle:{color:"var(--text-primary, #f4f4f5)"}},[e._v("快捷命令")]),t("button",{staticClass:"drawer-close",on:{click:function(n){e.showCommandDrawer=!1}}},[t("i",{staticClass:"fa-solid fa-xmark"})])]),t("div",{staticClass:"command-list"},[t("div",{staticClass:"command-item",on:{click:function(n){e.appendCommand("/compact"),e.showCommandDrawer=!1}}},[e._m(3),e._m(4)]),t("div",{staticClass:"command-item",on:{click:function(n){e.appendCommand("/clear"),e.showCommandDrawer=!1}}},[e._m(5),e._m(6)]),t("div",{staticClass:"command-item",on:{click:function(n){e.openFileSelect(),e.showCommandDrawer=!1}}},[e._m(7),e._m(8)])])])],1)},fpt=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"empty-icon"},[e("i",{staticClass:"fa-regular fa-comments"})])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"session-list-icon"},[e("i",{staticClass:"fa-solid fa-robot"})])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"command-icon"},[e("i",{staticClass:"fa-solid fa-microchip"})])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"command-icon"},[e("i",{staticClass:"fa-solid fa-compress-alt"})])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"command-info"},[e("div",{staticClass:"command-name"},[s._v("压缩会话")]),e("div",{staticClass:"command-desc"},[s._v("减少上下文长度")])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"command-icon"},[e("i",{staticClass:"fa-solid fa-trash"})])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"command-info"},[e("div",{staticClass:"command-name"},[s._v("清空对话")]),e("div",{staticClass:"command-desc"},[s._v("清空当前会话内容")])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"command-icon"},[e("i",{staticClass:"fa-solid fa-file-circle-plus"})])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"command-info"},[e("div",{staticClass:"command-name"},[s._v("选择文件")]),e("div",{staticClass:"command-desc"},[s._v("添加参考文件到上下文")])])}],gpt=en(upt,hpt,fpt,!1,null,"5ede8d97");const Tpe=gpt.exports,ppt={path:"/views/app",component:jgt,children:[{path:"",name:"app-index",component:Ygt,meta:{title:"首页"}},{path:"ChatViewApp",name:"app-ChatViewApp",component:Tpe,meta:{title:"对话"}},{path:"ChatViewApp/:id",name:"app-ChatViewApp-session",component:Tpe,meta:{title:"对话"}},{path:"FilesViewApp",name:"app-FilesViewApp",component:ept,meta:{title:"文件"}},{path:"GitChangesApp",name:"app-GitChangesApp",component:()=>ot(()=>import("./gitChangesApp-BOURDd_l.js"),__vite__mapDeps([2,3,4])),meta:{title:"Git 变更"}},{path:"DevWorkflowViewApp",name:"app-DevWorkflowViewApp",component:()=>ot(()=>import("./devWorkflowViewApp-DPlFgiS_.js"),__vite__mapDeps([5,6])),meta:{title:"软件研发"}},{path:"settings",name:"app-settings",component:pve,meta:{title:"设置"}}]};Is.use(eve);const mpt=[{path:"/",redirect:"/views/pc/codeView"},ppt,{path:"/views/pc",component:()=>ot(()=>import("./PcLayout-DeXNBHu2.js"),__vite__mapDeps([7,8])),children:[{path:"",redirect:"/views/pc/codeView"},{path:"codeView",name:"codeView",component:rce,meta:{title:"对话"}},{path:"codeView/:id",name:"codeView-session",component:rce,meta:{title:"对话"}},{path:"files",name:"files",component:Sft,meta:{title:"文件管理"}},{path:"fileZihao",name:"fileZihao",component:()=>ot(()=>import("./fileZihao-DvZmuTYu.js"),[]),meta:{title:"文件互联"}},{path:"skills",name:"skills",component:Pgt,meta:{title:"Skill 管理"}},{path:"terminal",name:"terminal",component:()=>ot(()=>import("./terminalView-q-UKzK0M.js"),__vite__mapDeps([9,10])),meta:{title:"终端"}},{path:"terminal/:id",name:"terminal-session",component:()=>ot(()=>import("./terminalView-q-UKzK0M.js"),__vite__mapDeps([9,10])),meta:{title:"终端"}},{path:"db",name:"db",component:Wgt,meta:{title:"数据库"}},{path:"aiLogs",name:"aiLogs",component:()=>ot(()=>import("./aiLogsView-JvjhLmyo.js"),[]),meta:{title:"AI 日志"}},{path:"tasks",name:"tasks",component:()=>ot(()=>import("./taskView-BcJ3LAxp.js"),[]),meta:{title:"任务列表"}},{path:"devWorkflow",name:"devWorkflow",component:()=>ot(()=>import("./devWorkflowView-BpdJTMEb.js"),__vite__mapDeps([11,12,13])),meta:{title:"软件研发"}},{path:"settings",name:"settings",component:pve,meta:{title:"设置"}},{path:"git-changes",name:"gitChanges",component:()=>ot(()=>import("./gitChanges-Cpf4HHoF.js"),__vite__mapDeps([14,3,15])),meta:{title:"Git 变更"}},{path:"custom-actions",name:"customActions",component:()=>ot(()=>import("./customActionsView-Cvmzxvl4.js"),[]),meta:{title:"自定义操作"}},{path:"wiki",name:"wiki",component:()=>ot(()=>import("./wikiView-B3GIPUlD.js"),__vite__mapDeps([16,17])),meta:{title:"文档"}},{path:"deploy",name:"deploy",component:()=>ot(()=>import("./deployView-CjV4ySrf.js"),__vite__mapDeps([18,19])),meta:{title:"部署"}},{path:"designView",name:"designView",component:()=>ot(()=>import("./designView-DrUNRVEE.js"),__vite__mapDeps([20,12,21])),meta:{title:"软件设计"}}]}],Kxe=new eve({mode:"hash",routes:mpt});Kxe.afterEach(s=>{var e;(e=s.meta)!=null&&e.title&&(document.title=`${s.meta.title} - TXCode`)});Is.use(fOe);Is.prototype.$api=Yt;Is.config.productionTip=!1;new Is({router:Kxe,render:s=>s(vOe)}).$mount("#app");const Gxe=document.createElement("style");Gxe.textContent=".v-modal { z-index: 1999 !important; }";document.head.appendChild(Gxe);export{r4e as C,jAe as F,p2e as I,l3 as K,e2e as M,d2e as R,YAe as S,Yt as a,yFe as b,r2e as c,a3 as d,$b as e,e4e as f,Gn as g,dpt as h,sve as i,VN as m,en as n,CFe as s,m0e as t,x2e as u,Cd as w};
|
|
952
|
+
`)};const o=await r.provideRenameEdits(this.model,this.position,e,n);if(o){if(o.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(o.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(w("no result","No result.")),n);return o}}async function but(s,e,t,i){const n=new zne(e,t,s),r=await n.resolveRenameLocation(zt.None);return r!=null&&r.rejectReason?{edits:[],rejectReason:r.rejectReason}:n.provideRenameEdits(i,zt.None)}var OC;let C_=(OC=class{static get(e){return e.getContribution(CQ.ID)}constructor(e,t,i,n,r,o,a,l,d){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=r,this._logService=o,this._configService=a,this._languageFeaturesService=l,this._telemetryService=d,this._disposableStore=new me,this._cts=new Bn,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(bQ,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var v,b;const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new Bn,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new zne(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const n=new m_(this.editor,5,void 0,this._cts.token);let r;try{e("resolving rename location");const y=i.resolveRenameLocation(n.token);this._progressService.showWhile(y,250),r=await y,e("resolved rename location")}catch(y){y instanceof Ed?e("resolve rename location cancelled",JSON.stringify(y,null," ")):(e("resolve rename location failed",y instanceof Error?y:JSON.stringify(y,null," ")),(typeof y=="string"||Mu(y))&&((v=al.get(this.editor))==null||v.showMessage(y||w("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),t)));return}finally{n.dispose()}if(!r){e("returning early - no loc");return}if(r.rejectReason){e(`returning early - rejected with reason: ${r.rejectReason}`,r.rejectReason),(b=al.get(this.editor))==null||b.showMessage(r.rejectReason,t);return}if(n.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const o=new m_(this.editor,5,r.range,this._cts.token),a=this.editor.getModel(),l=this._languageFeaturesService.newSymbolNamesProvider.all(a),d=await Promise.all(l.map(async y=>[y,await y.supportsAutomaticNewSymbolNamesTriggerKind??!1])),h=(y,x)=>{let D=d.slice();return y===kE.Automatic&&(D=D.filter(([S,I])=>I)),D.map(([S])=>S.provideNewSymbolNames(a,r.range,y,x))};e("creating rename input field and awaiting its result");const f=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),p=await this._renameWidget.getInput(r.range,r.text,f,l.length>0?h:void 0,o);if(e("received response from rename input field"),l.length>0&&this._reportTelemetry(l.length,a.getLanguageId(),p),typeof p=="boolean"){e(`returning early - rename input field response - ${p}`),p&&this.editor.focus(),o.dispose();return}this.editor.focus(),e("requesting rename edits");const m=_N(i.provideRenameEdits(p.newName,o.token),o.token).then(async y=>{if(!y){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(y.rejectReason){e(`returning early - rejected with reason: ${y.rejectReason}`),this._notificationService.info(y.rejectReason);return}this.editor.setSelection(W.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(y,{editor:this.editor,showPreview:p.wantsPreview,label:w("label","Renaming '{0}' to '{1}'",r==null?void 0:r.text,p.newName),code:"undoredo.rename",quotableLabel:w("quotableLabel","Renaming {0} to {1}",r==null?void 0:r.text,p.newName),respectAutoSaveConfig:!0}).then(x=>{e("edits applied"),x.ariaSummary&&Jo(w("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",r.text,p.newName,x.ariaSummary))}).catch(x=>{e(`error when applying edits ${JSON.stringify(x,null," ")}`),this._notificationService.error(w("rename.failedApply","Rename failed to apply edits")),this._logService.error(x)})},y=>{e("error when providing rename edits",JSON.stringify(y,null," ")),this._notificationService.error(w("rename.failed","Rename failed to compute edits")),this._logService.error(y)}).finally(()=>{o.dispose()});return e("returning rename operation"),this._progressService.showWhile(m,250),m}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}_reportTelemetry(e,t,i){const n=typeof i=="boolean"?{kind:"cancelled",languageId:t,nRenameSuggestionProviders:e}:{kind:"accepted",languageId:t,nRenameSuggestionProviders:e,source:i.stats.source.k,nRenameSuggestions:i.stats.nRenameSuggestions,timeBeforeFirstInputFieldEdit:i.stats.timeBeforeFirstInputFieldEdit,wantsPreview:i.wantsPreview,nRenameSuggestionsInvocations:i.stats.nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:i.stats.hadAutomaticRenameSuggestionsInvocation};this._telemetryService.publicLog2("renameInvokedEvent",n)}},CQ=OC,OC.ID="editor.contrib.renameController",OC);C_=CQ=vut([Op(1,ht),Op(2,ps),Op(3,kN),Op(4,D_),Op(5,Gr),Op(6,$V),Op(7,nt),Op(8,oo)],C_);class Cut extends Xe{constructor(){super({id:"editor.action.rename",label:w("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:ve.and(U.writable,U.hasRenameProvider),kbOpts:{kbExpr:U.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(wi),[n,r]=Array.isArray(t)&&t||[void 0,void 0];return pt.isUri(n)&&ie.isIPosition(r)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(o=>{o&&(o.setPosition(r),o.invokeWithinContext(a=>(this.reportTelemetry(a,o),this.run(a,o))))},Nt):super.runCommand(e,t)}run(e,t){const i=e.get(Gr),n=C_.get(t);return n?(i.trace("[RenameAction] got controller, running..."),n.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}pi(C_.ID,C_,4);Pe(Cut);const jne=zs.bindToContribution(C_.get);Ue(new jne({id:"acceptRenameInput",precondition:Jx,handler:s=>s.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:ve.and(U.focus,ve.not("isComposing")),primary:3}}));Ue(new jne({id:"acceptRenameInputWithPreview",precondition:ve.and(Jx,ve.has("config.editor.rename.enablePreview")),handler:s=>s.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:ve.and(U.focus,ve.not("isComposing")),primary:2051}}));Ue(new jne({id:"cancelRenameInput",precondition:Jx,handler:s=>s.cancelRenameInput(),kbOpts:{weight:199,kbExpr:U.focus,primary:9,secondary:[1033]}}));on(class extends ta{constructor(){super({id:"focusNextRenameSuggestion",title:{...Lt("focusNextRenameSuggestion","Focus Next Rename Suggestion")},precondition:Jx,keybinding:[{primary:18,weight:199}]})}run(e){const t=e.get(wi).getFocusedCodeEditor();if(!t)return;const i=C_.get(t);i&&i.focusNextRenameSuggestion()}});on(class extends ta{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...Lt("focusPreviousRenameSuggestion","Focus Previous Rename Suggestion")},precondition:Jx,keybinding:[{primary:16,weight:199}]})}run(e){const t=e.get(wi).getFocusedCodeEditor();if(!t)return;const i=C_.get(t);i&&i.focusPreviousRenameSuggestion()}});Ea("_executeDocumentRenameProvider",function(s,e,t,...i){const[n]=i;yi(typeof n=="string");const{renameProvider:r}=s.get(nt);return but(r,e,t,n)});Ea("_executePrepareRename",async function(s,e,t){const{renameProvider:i}=s.get(nt),r=await new zne(e,t,i).resolveRenameLocation(zt.None);if(r!=null&&r.rejectReason)throw new Error(r.rejectReason);return r});Wn.as(Bd.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:w("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var yut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},gpe=function(s,e){return function(t,i){e(t,i,s)}},wS;let J3=(wS=class extends re{constructor(e,t,i){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=i,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(73)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(n=>{var o;const r=(o=this.editor.getModel())==null?void 0:o.getLanguageId();r&&n.affects(r)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(n=>{this.options&&!n.hasChanged(73)||(this.options=this.createOptions(e.getOption(73)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(n=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(n=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new Ui(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const i=this.languageConfigurationService.getLanguageConfiguration(t).comments,n=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!i&&!(n!=null&&n.markers)))return{foldingRules:n,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){var i,n;if(!this.editor.hasModel()||!((i=this.options)!=null&&i.findMarkSectionHeaders)&&!((n=this.options)!=null&&n.findRegionSectionHeaders))return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(r=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(r)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(r=>{if(!r.shouldBeInComments)return!0;const o=t.validateRange(r.range),a=t.tokenization.getLineTokens(o.startLineNumber),l=a.findTokenIndexAtOffset(o.startColumn-1),d=a.getStandardTokenType(l);return a.getLanguageId(l)===t.getLanguageId()&&d===1}));const i=Object.values(this.currentOccurrences).map(r=>r.decorationId),n=e.map(r=>wut(r));this.editor.changeDecorations(r=>{const o=r.deltaDecorations(i,n);this.currentOccurrences={};for(let a=0,l=o.length;a<l;a++){const d={sectionHeader:e[a],decorationId:o[a]};this.currentOccurrences[d.decorationId]=d}})}stop(){this.computeSectionHeaders.cancel(),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop(),this.decorations.clear()}},wS.ID="editor.sectionHeaderDetector",wS);J3=yut([gpe(1,Vn),gpe(2,Na)],J3);function wut(s){return{range:s.range,options:At.createDynamic({description:"section-header",stickiness:3,collapseOnReplaceEdit:!0,minimap:{color:void 0,position:1,sectionHeaderStyle:s.hasSeparatorLine?2:1,sectionHeaderText:s.text}})}}pi(J3.ID,J3,1);function Sut(s){for(let e=0,t=s.length;e<t;e+=4){const i=s[e+0],n=s[e+1],r=s[e+2],o=s[e+3];s[e+0]=o,s[e+1]=r,s[e+2]=n,s[e+3]=i}}function xut(s){const e=new Uint8Array(s.buffer,s.byteOffset,s.length*4);return Eve()||Sut(e),WV.wrap(e)}function vxe(s){const e=new Uint32Array(kut(s));let t=0;if(e[t++]=s.id,s.type==="full")e[t++]=1,e[t++]=s.data.length,e.set(s.data,t),t+=s.data.length;else{e[t++]=2,e[t++]=s.deltas.length;for(const i of s.deltas)e[t++]=i.start,e[t++]=i.deleteCount,i.data?(e[t++]=i.data.length,e.set(i.data,t),t+=i.data.length):e[t++]=0}return xut(e)}function kut(s){let e=0;if(e+=2,s.type==="full")e+=1+s.data.length;else{e+=1,e+=3*s.deltas.length;for(const t of s.deltas)t.data&&(e+=t.data.length)}return e}function XH(s){return s&&!!s.data}function bxe(s){return s&&Array.isArray(s.edits)}class Lut{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function Cxe(s,e){return s.has(e)}function Dut(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function yxe(s,e,t,i,n){const r=Dut(s,e),o=await Promise.all(r.map(async a=>{let l,d=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?i:null,n)}catch(h){d=h,l=null}return(!l||!XH(l)&&!bxe(l))&&(l=null),new Lut(a,l,d)}));for(const a of o){if(a.error)throw a.error;if(a.tokens)return a}return o.length>0?o[0]:null}function Iut(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:null}class Eut{constructor(e,t){this.provider=e,this.tokens=t}}function Tut(s,e){return s.has(e)}function wxe(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function Une(s,e,t,i){const n=wxe(s,e),r=await Promise.all(n.map(async o=>{let a;try{a=await o.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){ns(l),a=null}return(!a||!XH(a))&&(a=null),new Eut(o,a)}));for(const o of r)if(o.tokens)return o;return r.length>0?r[0]:null}fi.registerCommand("_provideDocumentSemanticTokensLegend",async(s,...e)=>{const[t]=e;yi(t instanceof pt);const i=s.get(_n).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(nt),r=Iut(n,i);return r?r[0].getLegend():s.get(ln).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});fi.registerCommand("_provideDocumentSemanticTokens",async(s,...e)=>{const[t]=e;yi(t instanceof pt);const i=s.get(_n).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(nt);if(!Cxe(n,i))return s.get(ln).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const r=await yxe(n,i,null,null,zt.None);if(!r)return;const{provider:o,tokens:a}=r;if(!a||!XH(a))return;const l=vxe({id:0,type:"full",data:a.data});return a.resultId&&o.releaseDocumentSemanticTokens(a.resultId),l});fi.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(s,...e)=>{const[t,i]=e;yi(t instanceof pt);const n=s.get(_n).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:r}=s.get(nt),o=wxe(r,n);if(o.length===0)return;if(o.length===1)return o[0].getLegend();if(!i||!W.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),o[0].getLegend();const a=await Une(r,n,W.lift(i),zt.None);if(a)return a.provider.getLegend()});fi.registerCommand("_provideDocumentRangeSemanticTokens",async(s,...e)=>{const[t,i]=e;yi(t instanceof pt),yi(W.isIRange(i));const n=s.get(_n).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:r}=s.get(nt),o=await Une(r,n,W.lift(i),zt.None);if(!(!o||!o.tokens))return vxe({id:0,type:"full",data:o.tokens.data})});const qne="editor.semanticHighlighting";function RF(s,e,t){var n;const i=(n=t.getValue(qne,{overrideIdentifier:s.getLanguageId(),resource:s.uri}))==null?void 0:n.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var Sxe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Ph=function(s,e){return function(t,i){e(t,i,s)}},Wp;let yQ=class extends re{constructor(e,t,i,n,r,o){super(),this._watchers=Object.create(null);const a=h=>{this._watchers[h.uri.toString()]=new wQ(h,e,i,r,o)},l=(h,f)=>{f.dispose(),delete this._watchers[h.uri.toString()]},d=()=>{for(const h of t.getModels()){const f=this._watchers[h.uri.toString()];RF(h,i,n)?f||a(h):f&&l(h,f)}};t.getModels().forEach(h=>{RF(h,i,n)&&a(h)}),this._register(t.onModelAdded(h=>{RF(h,i,n)&&a(h)})),this._register(t.onModelRemoved(h=>{const f=this._watchers[h.uri.toString()];f&&l(h,f)})),this._register(n.onDidChangeConfiguration(h=>{h.affectsConfiguration(qne)&&d()})),this._register(i.onDidColorThemeChange(d))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};yQ=Sxe([Ph(0,jV),Ph(1,_n),Ph(2,js),Ph(3,Gt),Ph(4,sc),Ph(5,nt)],yQ);var Gm;let wQ=(Gm=class extends re{constructor(e,t,i,n,r){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=r.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:Wp.REQUEST_MIN_DELAY,max:Wp.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new Ui(()=>this._fetchDocumentSemanticTokensNow(),Wp.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const o=()=>{Qi(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};o(),this._register(this._provider.onDidChange(()=>{o(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(a=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),Qi(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!Cxe(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new Bn,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=yxe(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const r=[],o=this._model.onDidChangeContent(l=>{r.push(l)}),a=new ur(!1);n.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,r);else{const{provider:d,tokens:h}=l,f=this._semanticTokensStylingService.getStyling(d);this._setDocumentSemanticTokens(d,h||null,f,r)}},l=>{l&&(zc(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||Nt(l),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),(r.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,n,r){r=Math.min(r,i.length-n,e.length-t);for(let o=0;o<r;o++)i[n+o]=e[t+o]}_setDocumentSemanticTokens(e,t,i,n){const r=this._currentDocumentResponse,o=()=>{(n.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),o();return}if(bxe(t)){if(!r){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:r.data};else{let a=0;for(const p of t.edits)a+=(p.data?p.data.length:0)-p.deleteCount;const l=r.data,d=new Uint32Array(l.length+a);let h=l.length,f=d.length;for(let p=t.edits.length-1;p>=0;p--){const m=t.edits[p];if(m.start>l.length){i.warnInvalidEditStart(r.resultId,t.resultId,p,m.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const v=h-(m.start+m.deleteCount);v>0&&(Wp._copy(l,h-v,d,f-v,v),f-=v),m.data&&(Wp._copy(m.data,0,d,f-m.data.length,m.data.length),f-=m.data.length),h=m.start}h>0&&Wp._copy(l,0,d,0,h),t={resultId:t.resultId,data:d}}}if(XH(t)){this._currentDocumentResponse=new Nut(e,t.resultId,t.data);const a=CCe(t,i,this._model.getLanguageId());if(n.length>0)for(const l of n)for(const d of a)for(const h of l.changes)d.applyEdit(h.range,h.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);o()}},Wp=Gm,Gm.REQUEST_MIN_DELAY=300,Gm.REQUEST_MAX_DELAY=2e3,Gm);wQ=Wp=Sxe([Ph(1,jV),Ph(2,js),Ph(3,sc),Ph(4,nt)],wQ);class Nut{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}Ux(yQ);var Mut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},kD=function(s,e){return function(t,i){e(t,i,s)}},SS;let eB=(SS=class extends re{constructor(e,t,i,n,r,o){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=o.documentRangeSemanticTokensProvider,this._debounceInformation=r.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new Ui(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(l=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(l=>{l.affectsConfiguration(qne)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;t<i;t++)if(this._outstandingRequests[t]===e){this._outstandingRequests.splice(t,1);return}}_tokenizeViewportNow(){if(!this._editor.hasModel())return;const e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!RF(e,this._themeService,this._configurationService)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}if(!Tut(this._provider,e)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}const t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map(i=>this._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),n=Xs(o=>Promise.resolve(Une(this._provider,e,t,o))),r=new ur(!1);return n.then(o=>{if(this._debounceInformation.update(e,r.elapsed()),!o||!o.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:l}=o,d=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,CCe(l,d,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}},SS.ID="editor.contrib.viewportSemanticTokens",SS);eB=Mut([kD(1,jV),kD(2,js),kD(3,Gt),kD(4,sc),kD(5,nt)],eB);pi(eB.ID,eB,1);class Rut{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const r=[];i.push(r),this.selectSubwords&&this._addInWordRanges(r,e,n),this._addWordRanges(r,e,n),this._addWhitespaceLine(r,e,n),r.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:r,startColumn:o}=n,a=i.column-o;let l=a,d=a,h=0;for(;l>=0;l--){const f=r.charCodeAt(l);if(l!==a&&(f===95||f===45))break;if(am(f)&&Th(h))break;h=f}for(l+=1;d<r.length;d++){const f=r.charCodeAt(d);if(Th(f)&&am(h))break;if(f===95||f===45)break;h=f}l<d&&e.push({range:new W(i.lineNumber,o+l,i.lineNumber,o+d)})}_addWordRanges(e,t,i){const n=t.getWordAtPosition(i);n&&e.push({range:new W(i.lineNumber,n.startColumn,i.lineNumber,n.endColumn)})}_addWhitespaceLine(e,t,i){t.getLineLength(i.lineNumber)>0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new W(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var Put=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Out=function(s,e){return function(t,i){e(t,i,s)}},SQ;class Kne{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new Kne(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}var AC;let jT=(AC=class{static get(e){return e.getContribution(SQ.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)==null||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await kxe(this._languageFeaturesService.selectionRangeProvider,i,t.map(r=>r.getPosition()),this._editor.getOption(114),zt.None).then(r=>{var o;if(!(!xo(r)||r.length!==t.length)&&!(!this._editor.hasModel()||!Mn(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;a<r.length;a++)r[a]=r[a].filter(l=>l.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),r[a].unshift(t[a]);this._state=r.map(a=>new Kne(0,a)),(o=this._selectionListener)==null||o.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)==null||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(r=>r.mov(e));const n=this._state.map(r=>lt.fromPositions(r.ranges[r.index].getStartPosition(),r.ranges[r.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}},SQ=AC,AC.ID="editor.contrib.smartSelectController",AC);jT=SQ=Put([Out(1,nt)],jT);class xxe extends Xe{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=jT.get(t);i&&await i.run(this._forward)}}class Aut extends xxe{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:w("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:rt.MenubarSelectionMenu,group:"1_basic",title:w({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}fi.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class Fut extends xxe{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:w("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:rt.MenubarSelectionMenu,group:"1_basic",title:w({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}pi(jT.ID,jT,4);Pe(Aut);Pe(Fut);async function kxe(s,e,t,i,n){const r=s.all(e).concat(new Rut(i.selectSubwords));r.length===1&&r.unshift(new B3);const o=[],a=[];for(const l of r)o.push(Promise.resolve(l.provideSelectionRanges(e,t,n)).then(d=>{if(xo(d)&&d.length===t.length)for(let h=0;h<t.length;h++){a[h]||(a[h]=[]);for(const f of d[h])W.isIRange(f.range)&&W.containsPosition(f.range,t[h])&&a[h].push(W.lift(f.range))}},ns));return await Promise.all(o),a.map(l=>{if(l.length===0)return[];l.sort((p,m)=>ie.isBefore(p.getStartPosition(),m.getStartPosition())?1:ie.isBefore(m.getStartPosition(),p.getStartPosition())||ie.isBefore(p.getEndPosition(),m.getEndPosition())?-1:ie.isBefore(m.getEndPosition(),p.getEndPosition())?1:0);const d=[];let h;for(const p of l)(!h||W.containsRange(p,h)&&!W.equalsRange(p,h))&&(d.push(p),h=p);if(!i.selectLeadingAndTrailingWhitespace)return d;const f=[d[0]];for(let p=1;p<d.length;p++){const m=d[p-1],v=d[p];if(v.startLineNumber!==m.startLineNumber||v.endLineNumber!==m.endLineNumber){const b=new W(m.startLineNumber,e.getLineFirstNonWhitespaceColumn(m.startLineNumber),m.endLineNumber,e.getLineLastNonWhitespaceColumn(m.endLineNumber));b.containsRange(m)&&!b.equalsRange(m)&&v.containsRange(b)&&!v.equalsRange(b)&&f.push(b);const y=new W(m.startLineNumber,1,m.endLineNumber,e.getLineMaxColumn(m.endLineNumber));y.containsRange(m)&&!y.equalsRange(b)&&v.containsRange(y)&&!v.equalsRange(y)&&f.push(y)}f.push(v)}return f})}fi.registerCommand("_executeSelectionRangeProvider",async function(s,...e){const[t,i]=e;yi(pt.isUri(t));const n=s.get(nt).selectionRangeProvider,r=await s.get(Ia).createModelReference(t);try{return kxe(n,r.object.textEditorModel,i,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},zt.None)}finally{r.dispose()}});const But=Object.freeze({View:Lt("view","View"),Help:Lt("help","Help"),Test:Lt("test","Test"),File:Lt("file","File"),Preferences:Lt("preferences","Preferences"),Developer:Lt({key:"developer",comment:["A developer on Code itself or someone diagnosing issues in Code"]},"Developer")});class VI{constructor(e,t,i,n=null){this.startLineNumbers=e,this.endLineNumbers=t,this.lastLineRelativePosition=i,this.showEndForLine=n}equals(e){return!!e&&this.lastLineRelativePosition===e.lastLineRelativePosition&&this.showEndForLine===e.showEndForLine&&Mn(this.startLineNumbers,e.startLineNumbers)&&Mn(this.endLineNumbers,e.endLineNumbers)}static get Empty(){return new VI([],[],0)}}const ppe=Kg("stickyScrollViewLayer",{createHTML:s=>s}),Oj="data-sticky-line-index",mpe="data-sticky-is-line",Wut="data-sticky-is-line-number",_pe="data-sticky-is-folding-icon";class Vut extends re{constructor(e){super(),this._editor=e,this._foldingIconStore=new me,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(67),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof Od),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(116).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(116)&&t(),i.hasChanged(67)&&(this._lineHeight=this._editor.getOption(67))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(i=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getRenderedStickyLine(e){return this._renderedStickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i){if(i===void 0&&(!this._previousState&&!e||this._previousState&&this._previousState.equals(e)))return;const n=this._isWidgetHeightZero(e),r=n?void 0:e,o=n?0:this._findLineToRebuildWidgetFrom(e,i);this._renderRootNode(r,t,o),this._previousState=e}_isWidgetHeightZero(e){if(!e)return!0;const t=e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition;if(t>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const i=[...e.startLineNumbers];e.showEndForLine!==null&&(i[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=i}else this._lastLineRelativePosition=0,this._lineNumbers=[];return t===0}_findLineToRebuildWidgetFrom(e,t){if(!e||!this._previousState)return 0;if(t!==void 0)return t;const i=this._previousState,n=e.startLineNumbers.findIndex(r=>!i.startLineNumbers.includes(r));return n===-1?0:n}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_clearStickyLinesFromLine(e){this._foldingIconStore.clear();for(let t=e;t<this._renderedStickyLines.length;t++){const i=this._renderedStickyLines[t];i.lineNumberDomNode.remove(),i.lineDomNode.remove()}this._renderedStickyLines=this._renderedStickyLines.slice(0,e),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._renderedStickyLines){const i=t.foldingIcon;i&&i.setVisible(e?!0:i.isCollapsed)}}async _renderRootNode(e,t,i){if(this._clearStickyLinesFromLine(i),!e)return;for(const a of this._renderedStickyLines)this._updateTopAndZIndexOfStickyLine(a);const n=this._editor.getLayoutInfo(),r=this._lineNumbers.slice(i);for(const[a,l]of r.entries()){const d=this._renderChildNode(a+i,l,t,n);d&&(this._linesDomNode.appendChild(d.lineDomNode),this._lineNumbersDomNode.appendChild(d.lineNumberDomNode),this._renderedStickyLines.push(d))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const o=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${o}px`,this._linesDomNodeScrollable.style.height=`${o}px`,this._rootDomNode.style.height=`${o}px`,this._rootDomNode.style.marginLeft="0px",this._minContentWidthInPx=Math.max(...this._renderedStickyLines.map(a=>a.scrollWidth))+n.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(111)==="mouseover"&&(this._foldingIconStore.add(ue(this._lineNumbersDomNode,Ae.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(ue(this._lineNumbersDomNode,Ae.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,n){const r=this._editor._getViewModel();if(!r)return;const o=r.coordinatesConverter.convertModelPositionToViewPosition(new ie(t,1)).lineNumber,a=r.getViewLineRenderingData(o),l=this._editor.getOption(68);let d;try{d=jo.filter(a.inlineDecorations,o,a.minColumn,a.maxColumn)}catch{d=[]}const h=new N_(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,d,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),f=new Mx(2e3),p=FN(h,f);let m;ppe?m=ppe.createHTML(f.build()):m=f.build();const v=document.createElement("span");v.setAttribute(Oj,String(e)),v.setAttribute(mpe,""),v.setAttribute("role","listitem"),v.tabIndex=0,v.className="sticky-line-content",v.classList.add(`stickyLine${t}`),v.style.lineHeight=`${this._lineHeight}px`,v.innerHTML=m;const b=document.createElement("span");b.setAttribute(Oj,String(e)),b.setAttribute(Wut,""),b.className="sticky-line-number",b.style.lineHeight=`${this._lineHeight}px`;const y=n.contentLeft;b.style.width=`${y}px`;const x=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?x.innerText=t.toString():l.renderType===2&&(x.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),x.className="sticky-line-number-inner",x.style.lineHeight=`${this._lineHeight}px`,x.style.width=`${n.lineNumbersWidth}px`,x.style.paddingLeft=`${n.lineNumbersLeft}px`,b.appendChild(x);const D=this._renderFoldingIconForLine(i,t);D&&b.appendChild(D.domNode),this._editor.applyFontInfo(v),this._editor.applyFontInfo(x),b.style.lineHeight=`${this._lineHeight}px`,v.style.lineHeight=`${this._lineHeight}px`,b.style.height=`${this._lineHeight}px`,v.style.height=`${this._lineHeight}px`;const S=new Hut(e,t,v,b,D,p.characterMapping,v.scrollWidth);return this._updateTopAndZIndexOfStickyLine(S)}_updateTopAndZIndexOfStickyLine(e){var h;const t=e.index,i=e.lineDomNode,n=e.lineNumberDomNode,r=t===this._lineNumbers.length-1,o="0",a="1";i.style.zIndex=r?o:a,n.style.zIndex=r?o:a;const l=`${t*this._lineHeight+this._lastLineRelativePosition+((h=e.foldingIcon)!=null&&h.isCollapsed?1:0)}px`,d=`${t*this._lineHeight}px`;return i.style.top=r?l:d,n.style.top=r?l:d,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(111);if(!e||i==="never")return;const n=e.regions,r=n.findRange(t),o=n.getStartLineNumber(r);if(!(t===o))return;const l=n.isCollapsed(r),d=new $ut(l,o,n.getEndLineNumber(r),this._lineHeight);return d.setVisible(this._isOnGlyphMargin?!0:l||i==="always"),d.domNode.setAttribute(_pe,""),d}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:2,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e<this._renderedStickyLines.length&&this._renderedStickyLines[e].lineDomNode.focus()}getEditorPositionFromNode(e){if(!e||e.children.length>0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=yie(t.characterMapping,e,0);return new ie(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t;return((t=this._getRenderedStickyLineFromChildDomNode(e))==null?void 0:t.lineNumber)??null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._renderedStickyLines.length?null:this._renderedStickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,Oj);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,mpe)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,_pe)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class Hut{constructor(e,t,i,n,r,o,a){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=r,this.characterMapping=o,this.scrollWidth=a}}class $ut{constructor(e,t,i,n){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=n,this.domNode=document.createElement("div"),this.domNode.style.width=`${n}px`,this.domNode.style.height=`${n}px`,this.domNode.className=Ct.asClassName(e?D3:L3)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class HI{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class tB{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class Lxe{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}}var QH=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},UT=function(s,e){return function(t,i){e(t,i,s)}},$I;(function(s){s.OUTLINE_MODEL="outlineModel",s.FOLDING_PROVIDER_MODEL="foldingProviderModel",s.INDENTATION_MODEL="indentationModel"})($I||($I={}));var bm;(function(s){s[s.VALID=0]="VALID",s[s.INVALID=1]="INVALID",s[s.CANCELED=2]="CANCELED"})(bm||(bm={}));let xQ=class extends re{constructor(e,t,i,n){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Ac(300)),this._updateOperation=this._register(new me),this._editor.getOption(116).defaultModel){case $I.OUTLINE_MODEL:this._modelProviders.push(new kQ(this._editor,n));case $I.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new DQ(this._editor,t,n));case $I.INDENTATION_MODEL:this._modelProviders.push(new LQ(this._editor,i));break}}dispose(){this._modelProviders.forEach(e=>e.dispose()),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const t of this._modelProviders){const{statusPromise:i,modelPromise:n}=t.computeStickyModel(e);this._modelPromise=n;const r=await i;if(this._modelPromise!==n)return null;switch(r){case bm.CANCELED:return this._updateOperation.clear(),null;case bm.VALID:return t.stickyModel}}return null}).catch(t=>(Nt(t),null))}};xQ=QH([UT(2,ht),UT(3,nt)],xQ);class Dxe extends re{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,bm.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=Xs(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?bm.CANCELED:(this._stickyModel=this.createStickyModel(e,i),bm.VALID):this._invalid()).then(void 0,i=>(Nt(i),bm.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let kQ=class extends Dxe{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return Jf.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){var o;const{stickyOutlineElement:i,providerID:n}=this._stickyModelFromOutlineModel(t,(o=this._stickyModel)==null?void 0:o.outlineProviderId),r=this._editor.getModel();return new Lxe(r.uri,r.getVersionId(),i,n)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(hi.first(e.children.values())instanceof GSe){const a=hi.find(e.children.values(),l=>l.id===t);if(a)i=a.children;else{let l="",d=-1,h;for(const[f,p]of e.children.entries()){const m=this._findSumOfRangesOfGroup(p);m>d&&(h=p,d=m,l=p.id)}t=l,i=h.children}}else i=e.children;const n=[],r=Array.from(i.values()).sort((a,l)=>{const d=new HI(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),h=new HI(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(d,h)});for(const a of r)n.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new tB(void 0,n,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const r of e.children.values())if(r.symbol.selectionRange.startLineNumber!==r.symbol.range.endLineNumber)if(r.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(r,r.symbol.selectionRange.startLineNumber));else for(const o of r.children.values())i.push(this._stickyModelFromOutlineElement(o,r.symbol.selectionRange.startLineNumber));i.sort((r,o)=>this._comparator(r.range,o.range));const n=new HI(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new tB(n,i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof gX?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};kQ=QH([UT(1,nt)],kQ);class Ixe extends Dxe{constructor(e){super(e),this._foldingLimitReporter=new USe(e)}createStickyModel(e,t){const i=this._fromFoldingRegions(t),n=this._editor.getModel();return new Lxe(n.uri,n.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],n=new tB(void 0,[],void 0);for(let r=0;r<t;r++){const o=e.getParentIndex(r);let a;o!==-1?a=i[o]:a=n;const l=new tB(new HI(e.getStartLineNumber(r),e.getEndLineNumber(r)+1),[],a);a.children.push(l),i.push(l)}return n}}let LQ=class extends Ixe{constructor(e,t){super(e),this._languageConfigurationService=t,this.provider=this._register(new Mne(e.getModel(),this._languageConfigurationService,this._foldingLimitReporter))}async createModelFromProvider(e){return this.provider.compute(e)}};LQ=QH([UT(1,Vn)],LQ);let DQ=class extends Ixe{constructor(e,t,i){super(e),this._languageFeaturesService=i;const n=b_.getFoldingRangeProviders(this._languageFeaturesService,e.getModel());n.length>0&&(this.provider=this._register(new Rne(e.getModel(),n,t,this._foldingLimitReporter,void 0)))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){var t;return((t=this.provider)==null?void 0:t.compute(e))??null}};DQ=QH([UT(2,nt)],DQ);var zut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},vpe=function(s,e){return function(t,i){e(t,i,s)}};class jut{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}let IQ=class extends re{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new se),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new me),this._updateSoon=this._register(new Ui(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(116)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(116).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this.updateStickyModelProvider(),this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this._sessionStore.add(ut(()=>{var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){var e;return(e=this._model)==null?void 0:e.version}updateStickyModelProvider(){var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null;const e=this._editor;e.hasModel()&&(this._stickyModelProvider=new xQ(e,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){var e;(e=this._cts)==null||e.dispose(!0),this._cts=new Bn,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=await this._stickyModelProvider.update(e);e.isCancellationRequested||(this._model=t)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,n,r){if(t.children.length===0)return;let o=r;const a=[];for(let h=0;h<t.children.length;h++){const f=t.children[h];f.range&&a.push(f.range.startLineNumber)}const l=this.updateIndex(_E(a,e.startLineNumber,(h,f)=>h-f)),d=this.updateIndex(_E(a,e.startLineNumber+n,(h,f)=>h-f));for(let h=l;h<=d;h++){const f=t.children[h];if(!f)return;if(f.range){const p=f.range.startLineNumber,m=f.range.endLineNumber;e.startLineNumber<=m+1&&p-1<=e.endLineNumber&&p!==o&&(o=p,i.push(new jut(p,m-1,n+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,f,i,n+1,p))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,f,i,n,r)}}getCandidateStickyLinesIntersecting(e){var n,r;if(!((n=this._model)!=null&&n.element))return[];let t=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,t,0,-1);const i=(r=this._editor._getViewModel())==null?void 0:r.getHiddenAreas();if(i)for(const o of i)t=t.filter(a=>!(a.startLineNumber>=o.startLineNumber&&a.endLineNumber<=o.endLineNumber+1));return t}};IQ=zut([vpe(1,nt),vpe(2,Vn)],IQ);var Uut=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},V1=function(s,e){return function(t,i){e(t,i,s)}},EQ,FC;let jg=(FC=class extends re{constructor(e,t,i,n,r,o,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=n,this._contextKeyService=a,this._sessionStore=new me,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._stickyScrollWidget=new Vut(this._editor),this._stickyLineCandidateProvider=new IQ(this._editor,i,r),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=VI.Empty,this._onDidResize(),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(h=>{this._readConfigurationChange(h)})),this._register(ue(l,Ae.CONTEXT_MENU,async h=>{this._onContextMenu(_t(l),h)})),this._stickyScrollFocusedContextKey=U.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=U.stickyScrollVisible.bindTo(this._contextKeyService);const d=this._register(Ou(l));this._register(d.onDidBlur(h=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(d.onDidFocus(h=>{this.focus()})),this._registerMouseListeners(),this._register(ue(l,Ae.MOUSE_DOWN,h=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(EQ.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)==null||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new me,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex<this._stickyScrollWidget.lineNumberCount-1&&this._focusNav(!0)}focusPrevious(){this._focusedStickyElementIndex>0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(W.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new me),t=this._register(new HH(this._editor,{extractLineNumberFromMouseEvent:r=>{const o=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);return o?o.lineNumber:0}})),i=r=>{if(!this._editor.hasModel()||r.target.type!==12||r.target.detail!==this._stickyScrollWidget.getId())return null;const o=r.target.element;if(!o||o.innerText!==o.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(o);return a?{range:new W(a.lineNumber,a.column,a.lineNumber,a.column+o.innerText.length),textElement:o}:null},n=this._stickyScrollWidget.getDomNode();this._register($n(n,Ae.CLICK,r=>{if(r.ctrlKey||r.altKey||r.metaKey||!r.leftButton)return;if(r.shiftKey){const d=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(d===null)return;const h=new ie(this._endLineNumbers[d],1);this._revealLineInCenterIfOutsideViewport(h);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(r.target)){const d=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);this._toggleFoldingRegionForLine(d);return}if(!this._stickyScrollWidget.isInStickyLine(r.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(r.target);if(!l){const d=this._stickyScrollWidget.getLineNumberFromChildDomNode(r.target);if(d===null)return;l=new ie(d,1)}this._revealPosition(l)})),this._register($n(n,Ae.MOUSE_MOVE,r=>{if(r.shiftKey){const o=this._stickyScrollWidget.getLineIndexFromChildDomNode(r.target);if(o===null||this._showEndForLine!==null&&this._showEndForLine===o)return;this._showEndForLine=o,this._renderStickyScroll();return}this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(ue(n,Ae.MOUSE_LEAVE,r=>{this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([r,o])=>{const a=i(r);if(!a||!r.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:d}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(d.style.textDecoration==="underline")return;const h=new Bn;e.add(ut(()=>h.dispose(!0)));let f;KN(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new ie(l.startLineNumber,l.startColumn+1),!1,h.token).then(p=>{if(!h.token.isCancellationRequested)if(p.length!==0){this._candidateDefinitionsLength=p.length;const m=d;f!==m?(e.clear(),f=m,f.style.textDecoration="underline",e.add(ut(()=>{f.style.textDecoration="none"}))):f||(f=m,f.style.textDecoration="underline",e.add(ut(()=>{f.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async r=>{if(r.target.type!==12||r.target.detail!==this._stickyScrollWidget.getId())return;const o=this._stickyScrollWidget.getEditorPositionFromNode(r.target.element);o&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:o.lineNumber,column:1})),this._instaService.invokeFunction(ISe,r,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new yd(e,t);this._contextMenuService.showContextMenu({menuId:rt.StickyScrollContext,getAnchor:()=>i})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t==null?void 0:t.foldingIcon;if(!i)return;Ene(this._foldingModel,Number.MAX_VALUE,[e]),i.isCollapsed=!i.isCollapsed;const n=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(67)*t.index+1;this._editor.setScrollTop(n),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(116);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(i=>{i.scrollTopChanged&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(i=>this._onTokensChange(i))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=void 0,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(68).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=void 0,this._renderStickyScroll(0)}))}_readConfigurationChange(e){(e.hasChanged(116)||e.hasChanged(73)||e.hasChanged(67)||e.hasChanged(111)||e.hasChanged(68))&&this._readConfiguration(),e.hasChanged(68)&&this._renderStickyScroll(0)}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const n of e.ranges)if(i>=n.fromLineNumber&&i<=n.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(0)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(67);this._maxStickyLines=Math.round(t*.25)}async _renderStickyScroll(e){const t=this._editor.getModel();if(!t||t.isTooLargeForTokenization()){this._resetState();return}const i=this._updateAndGetMinRebuildFromLine(e),n=this._stickyLineCandidateProvider.getVersionId();if(n===void 0||n===t.getVersionId())if(!this._focused)await this._updateState(i);else if(this._focusedStickyElementIndex===-1)await this._updateState(i),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const o=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(i),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(o)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}_updateAndGetMinRebuildFromLine(e){if(e!==void 0){const t=this._minRebuildFromLine!==void 0?this._minRebuildFromLine:1/0;this._minRebuildFromLine=Math.min(e,t)}return this._minRebuildFromLine}async _updateState(e){var i;this._minRebuildFromLine=void 0,this._foldingModel=await((i=b_.get(this._editor))==null?void 0:i.getFoldingModel())??void 0,this._widgetState=this.findScrollWidgetState();const t=this._widgetState.startLineNumbers.length>0;this._stickyScrollVisibleContextKey.set(t),this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}async _resetState(){this._minRebuildFromLine=void 0,this._foldingModel=void 0,this._widgetState=VI.Empty,this._stickyScrollVisibleContextKey.set(!1),this._stickyScrollWidget.setState(void 0,void 0)}findScrollWidgetState(){const e=this._editor.getOption(67),t=Math.min(this._maxStickyLines,this._editor.getOption(116).maxLineCount),i=this._editor.getScrollTop();let n=0;const r=[],o=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new HI(a[0].startLineNumber,a[a.length-1].endLineNumber),d=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const h of d){const f=h.startLineNumber,p=h.endLineNumber,m=h.nestingDepth;if(p-f>0){const v=(m-1)*e,b=m*e,y=this._editor.getBottomForLineNumber(f)-i,x=this._editor.getTopForLineNumber(p)-i,D=this._editor.getBottomForLineNumber(p)-i;if(v>x&&v<=D){r.push(f),o.push(p+1),n=D-b;break}else b>y&&b<=D&&(r.push(f),o.push(p+1));if(r.length===t)break}}}return this._endLineNumbers=o,new VI(r,o,n,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},EQ=FC,FC.ID="store.contrib.stickyScrollController",FC);jg=EQ=Uut([V1(1,gl),V1(2,nt),V1(3,ht),V1(4,Vn),V1(5,sc),V1(6,wt)],jg);class qut extends ta{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...Lt("toggleEditorStickyScroll","Toggle Editor Sticky Scroll"),mnemonicTitle:w({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Editor Sticky Scroll")},metadata:{description:Lt("toggleEditorStickyScroll.description","Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:But.View,toggled:{condition:ve.equals("config.editor.stickyScroll.enabled",!0),title:w("stickyScroll","Sticky Scroll"),mnemonicTitle:w({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:rt.CommandPalette},{id:rt.MenubarAppearanceMenu,group:"4_editor",order:3},{id:rt.StickyScrollContext}]})}async run(e){const t=e.get(Gt),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}}const JH=100;class Kut extends Uu{constructor(){super({id:"editor.action.focusStickyScroll",title:{...Lt("focusStickyScroll","Focus on the editor sticky scroll"),mnemonicTitle:w({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll")},precondition:ve.and(ve.has("config.editor.stickyScroll.enabled"),U.stickyScrollVisible),menu:[{id:rt.CommandPalette}]})}runEditorCommand(e,t){var i;(i=jg.get(t))==null||i.focus()}}class Gut extends Uu{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:Lt("selectNextStickyScrollLine.title","Select the next editor sticky scroll line"),precondition:U.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:JH,primary:18}})}runEditorCommand(e,t){var i;(i=jg.get(t))==null||i.focusNext()}}class Yut extends Uu{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:Lt("selectPreviousStickyScrollLine.title","Select the previous sticky scroll line"),precondition:U.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:JH,primary:16}})}runEditorCommand(e,t){var i;(i=jg.get(t))==null||i.focusPrevious()}}class Zut extends Uu{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:Lt("goToFocusedStickyScrollLine.title","Go to the focused sticky scroll line"),precondition:U.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:JH,primary:3}})}runEditorCommand(e,t){var i;(i=jg.get(t))==null||i.goToFocused()}}class Xut extends Uu{constructor(){super({id:"editor.action.selectEditor",title:Lt("selectEditor.title","Select Editor"),precondition:U.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:JH,primary:9}})}runEditorCommand(e,t){var i;(i=jg.get(t))==null||i.selectEditor()}}pi(jg.ID,jg,1);on(qut);on(Kut);on(Yut);on(Gut);on(Zut);on(Xut);var Exe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},JD=function(s,e){return function(t,i){e(t,i,s)}};class Qut{constructor(e,t,i,n,r,o){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=r,this.completion=o}}let TQ=class extends D5e{constructor(e,t,i,n,r,o){super(r.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=o}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn<i.endColumn&&this.completionModel.getIncompleteProvider().size===0}get items(){const e=[],{items:t}=this.completionModel,i=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},t),n=hi.slice(t,i),r=hi.slice(t,0,i);let o=5;for(const a of hi.concat(n,r)){if(a.score===Nu.Default)continue;const l=new W(a.editStart.lineNumber,a.editStart.column,a.editInsertEnd.lineNumber,a.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),d=a.completion.insertTextRules&&a.completion.insertTextRules&4?{snippet:a.completion.insertText}:a.completion.insertText;e.push(new Qut(l,d,a.filterTextLow??a.labelLow,a.completion.additionalTextEdits,a.completion.command,a)),o-->=0&&a.resolve(zt.None)}return e}};TQ=Exe([JD(5,GH)],TQ);let NQ=class extends re{constructor(e,t,i,n){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=n,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,n){var m;if(i.selectedSuggestionInfo)return;let r;for(const v of this._editorService.listCodeEditors())if(v.getModel()===e){r=v;break}if(!r)return;const o=r.getOption(90);if(w0.isAllOff(o))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(w0.valueFor(o,l)!=="inline")return;let d=e.getWordAtPosition(t),h;if(d!=null&&d.word||(h=this._getTriggerCharacterInfo(e,t)),!(d!=null&&d.word)&&!h||(d||(d=e.getWordUntilPosition(t)),d.endColumn!==t.column))return;let f;const p=e.getValueInRange(new W(t.lineNumber,1,t.lineNumber,t.column));if(!h&&((m=this._lastResult)!=null&&m.canBeReused(e,t.lineNumber,d))){const v=new npe(p,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=v,this._lastResult.acquire(),f=this._lastResult}else{const v=await Pne(this._languageFeatureService.completionProvider,e,t,new AT(void 0,V3.createSuggestFilter(r).itemKind,h==null?void 0:h.providers),h&&{triggerKind:1,triggerCharacter:h.ch},n);let b;v.needsClipboard&&(b=await this._clipboardService.readText());const y=new tm(v.items,t.column,new npe(p,0),W3.None,r.getOption(119),r.getOption(113),{boostFullMatch:!1,firstMatchCanBeWeak:!1},b);f=new TQ(e,t.lineNumber,d,y,v,this._suggestMemoryService)}return this._lastResult=f,f}handleItemDidShow(e,t){t.completion.resolve(zt.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var r;const i=e.getValueInRange(W.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),n=new Set;for(const o of this._languageFeatureService.completionProvider.all(e))(r=o.triggerCharacters)!=null&&r.includes(i)&&n.add(o);if(n.size!==0)return{providers:n,ch:i}}};NQ=Exe([JD(0,nt),JD(1,Xg),JD(2,GH),JD(3,wi)],NQ);Ux(NQ);class Jut extends Xe{constructor(){super({id:"editor.action.forceRetokenize",label:w("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const n=new ur;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}Pe(Jut);const RW=class RW extends ta{constructor(){super({id:RW.ID,title:Lt({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:Lt("tabMovesFocusDescriptions","Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const t=!XS.getTabFocusMode();XS.setTabFocusMode(t),Jo(t?w("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):w("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}};RW.ID="editor.action.toggleTabFocusMode";let MQ=RW;on(MQ);var eht=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},bpe=function(s,e){return function(t,i){e(t,i,s)}};let RQ=class extends re{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,i={},n,r){super(),this._link=t,this._hoverService=n,this._enabled=!0,this.el=Ie(e,Fe("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??ia("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const o=this._register(new ri(this.el,"click")),a=this._register(new ri(this.el,"keypress")),l=We.chain(a.event,f=>f.map(p=>new rn(p)).filter(p=>p.keyCode===3)),d=this._register(new ri(this.el,an.Tap)).event;this._register(so.addTarget(this.el));const h=We.any(o.event,l,d);this._register(h(f=>{this.enabled&&(li.stop(f,!0),i!=null&&i.opener?i.opener(this._link.href):r.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){this.hoverDelegate.showNativeHover?this.el.title=e??"":!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};RQ=eht([bpe(3,uf),bpe(4,Ta)],RQ);var Txe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Nxe=function(s,e){return function(t,i){e(t,i,s)}};const tht=26;let PQ=class extends re{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(OQ))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{var t;this.hide(),(t=e.onClose)==null||t.call(e)}}),this._editor.setBanner(this.banner.element,tht)}};PQ=Txe([Nxe(1,ht)],PQ);let OQ=class extends re{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(Bg,{}),this.element=Fe("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=Fe("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){kr(this.element)}show(e){kr(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=Ie(this.element,Fe("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(Fe(`div${Ct.asCSSSelector(e.icon)}`));const n=Ie(this.element,Fe("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=Ie(this.element,Fe("div.message-actions-container")),e.actions)for(const o of e.actions)this._register(this.instantiationService.createInstance(RQ,this.messageActionsContainer,{...o,tabIndex:-1},{}));const r=Ie(this.element,Fe("div.action-container"));this.actionBar=this._register(new Zl(r)),this.actionBar.push(this._register(new rl("banner.close","Close Banner",Ct.asClassName(Jwe),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};OQ=Txe([Nxe(0,ht)],OQ);var Gne=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},fS=function(s,e){return function(t,i){e(t,i,s)}};const iht=vn("extensions-warning-message",Oe.warning,w("warningIcon","Icon shown with a warning message in the extensions editor."));var xS;let qT=(xS=class extends re{constructor(e,t,i,n){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=r=>{if(r&&r.hasMore){if(this._bannerClosed)return;const o=Math.max(r.ambiguousCharacterCount,r.nonBasicAsciiCharacterCount,r.invisibleCharacterCount);let a;if(r.nonBasicAsciiCharacterCount>=o)a={message:w("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new GT};else if(r.ambiguousCharacterCount>=o)a={message:w("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new yy};else if(r.invisibleCharacterCount>=o)a={message:w("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new KT};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:iht,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(PQ,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(126),this._register(i.onDidChangeTrust(r=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(r=>{r.hasChanged(126)&&(this._options=e.getOption(126),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=nht(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?new Intl.NumberFormat().resolvedOptions().locale:i==="_vscode"?k4e:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new AQ(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new sht(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},xS.ID="editor.contrib.unicodeHighlighter",xS);qT=Gne([fS(1,Na),fS(2,pye),fS(3,ht)],qT);function nht(s,e){return{nonBasicASCII:e.nonBasicASCII===Nl?!s:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Nl?!s:e.includeComments,includeStrings:e.includeStrings===Nl?!s:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let AQ=class extends re{constructor(e,t,i,n){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Ui(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const n of t.ranges)i.push({range:n,options:iB.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!Aie(t,e))return null;const i=t.getValueInRange(e.range);return{reason:Rxe(i,this._options),inComment:Fie(t,e),inString:Bie(t,e)}}};AQ=Gne([fS(3,Na)],AQ);class sht extends re{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Ui(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const n of e){const r=Yee.computeUnicodeHighlights(this._model,this._options,n);for(const o of r.ranges)i.ranges.push(o);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||r.hasMore}if(!i.hasMore)for(const n of i.ranges)t.push({range:n,options:iB.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return Aie(t,e)?{reason:Rxe(i,this._options),inComment:Fie(t,e),inString:Bie(t,e)}:null}}const Mxe=w("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options");let FQ=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=this._editor.getContribution(qT.ID);if(!n)return[];const r=[],o=new Set;let a=300;for(const l of t){const d=n.getDecorationInfo(l);if(!d)continue;const f=i.getValueInRange(l.range).codePointAt(0),p=Aj(f);let m;switch(d.reason.kind){case 0:{pN(d.reason.confusableWith)?m=w("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",p,Aj(d.reason.confusableWith.codePointAt(0))):m=w("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",p,Aj(d.reason.confusableWith.codePointAt(0)));break}case 1:m=w("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",p);break;case 2:m=w("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",p);break}if(o.has(m))continue;o.add(m);const v={codePoint:f,reason:d.reason,inComment:d.inComment,inString:d.inString},b=w("unicodeHighlight.adjustSettings","Adjust settings"),y=`command:${nB.ID}?${encodeURIComponent(JSON.stringify(v))}`,x=new io("",!0).appendMarkdown(m).appendText(" ").appendLink(y,b,Mxe);r.push(new bd(this,l.range,[x],!1,a++))}return r}renderHoverParts(e,t){return Rst(e,t,this._editor,this._languageService,this._openerService)}};FQ=Gne([fS(1,Rn),fS(2,Ta)],FQ);function BQ(s){return`U+${s.toString(16).padStart(4,"0")}`}function Aj(s){let e=`\`${BQ(s)}\``;return Mb.isInvisibleCharacter(s)||(e+=` "${`${rht(s)}`}"`),e}function rht(s){return s===96?"`` ` ``":"`"+String.fromCodePoint(s)+"`"}function Rxe(s,e){return Yee.computeUnicodeHighlightReason(s,e)}const PW=class PW{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let n=this.map.get(i);return n||(n=At.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}};PW.instance=new PW;let iB=PW;class oht extends Xe{constructor(){super({id:yy.ID,label:w("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}async run(e,t,i){const n=e==null?void 0:e.get(Gt);n&&this.runAction(n)}async runAction(e){await e.updateValue(ga.includeComments,!1,2)}}class aht extends Xe{constructor(){super({id:yy.ID,label:w("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}async run(e,t,i){const n=e==null?void 0:e.get(Gt);n&&this.runAction(n)}async runAction(e){await e.updateValue(ga.includeStrings,!1,2)}}const OW=class OW extends Xe{constructor(){super({id:OW.ID,label:w("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}async run(e,t,i){const n=e==null?void 0:e.get(Gt);n&&this.runAction(n)}async runAction(e){await e.updateValue(ga.ambiguousCharacters,!1,2)}};OW.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let yy=OW;const AW=class AW extends Xe{constructor(){super({id:AW.ID,label:w("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}async run(e,t,i){const n=e==null?void 0:e.get(Gt);n&&this.runAction(n)}async runAction(e){await e.updateValue(ga.invisibleCharacters,!1,2)}};AW.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let KT=AW;const FW=class FW extends Xe{constructor(){super({id:FW.ID,label:w("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=w("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}async run(e,t,i){const n=e==null?void 0:e.get(Gt);n&&this.runAction(n)}async runAction(e){await e.updateValue(ga.nonBasicASCII,!1,2)}};FW.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let GT=FW;const BW=class BW extends Xe{constructor(){super({id:BW.ID,label:w("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){const{codePoint:n,reason:r,inString:o,inComment:a}=i,l=String.fromCodePoint(n),d=e.get(Uc),h=e.get(Gt);function f(v){return Mb.isInvisibleCharacter(v)?w("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",BQ(v)):w("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${BQ(v)} "${l}"`)}const p=[];if(r.kind===0)for(const v of r.notAmbiguousInLocales)p.push({label:w("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',v),run:async()=>{cht(h,[v])}});if(p.push({label:f(n),run:()=>lht(h,[n])}),a){const v=new oht;p.push({label:v.label,run:async()=>v.runAction(h)})}else if(o){const v=new aht;p.push({label:v.label,run:async()=>v.runAction(h)})}if(r.kind===0){const v=new yy;p.push({label:v.label,run:async()=>v.runAction(h)})}else if(r.kind===1){const v=new KT;p.push({label:v.label,run:async()=>v.runAction(h)})}else if(r.kind===2){const v=new GT;p.push({label:v.label,run:async()=>v.runAction(h)})}else dht(r);const m=await d.pick(p,{title:Mxe});m&&await m.run()}};BW.ID="editor.action.unicodeHighlight.showExcludeOptions";let nB=BW;async function lht(s,e){const t=s.getValue(ga.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await s.updateValue(ga.allowedCharacters,i,2)}async function cht(s,e){var n;const t=(n=s.inspect(ga.allowedLocales).user)==null?void 0:n.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const r of e)i[r]=!0;await s.updateValue(ga.allowedLocales,i,2)}function dht(s){throw new Error(`Unexpected value: ${s}`)}Pe(yy);Pe(KT);Pe(GT);Pe(nB);pi(qT.ID,qT,1);qy.register(FQ);var uht=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Cpe=function(s,e){return function(t,i){e(t,i,s)}};const Pxe="ignoreUnusualLineTerminators";function hht(s,e,t){s.setModelProperty(e.uri,Pxe,t)}function fht(s,e){return s.getModelProperty(e.uri,Pxe)}var kS;let sB=(kS=class extends re{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(127),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(127)&&(this._config=this._editor.getOption(127),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(n=>{n.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||fht(this._codeEditorService,e)===!0||this._editor.getOption(92))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:w("unusualLineTerminators.title","Unusual Line Terminators"),message:w("unusualLineTerminators.message","Detected unusual line terminators"),detail:w("unusualLineTerminators.detail","The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",Wc(e.uri)),primaryButton:w({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:w("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){hht(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},kS.ID="editor.contrib.unusualLineTerminatorsDetector",kS);sB=uht([Cpe(1,CN),Cpe(2,wi)],sB);pi(sB.ID,sB,1);var ght=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},pht=function(s,e){return function(t,i){e(t,i,s)}};class ype{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,i){const n=[],r=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return r?e.isDisposed()?void 0:e.findMatches(r.word,!0,!1,!0,d4,!1).map(a=>({range:a.range,kind:TS.Text})):Promise.resolve(n)}provideMultiDocumentHighlights(e,t,i,n){const r=new dr,o=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!o)return Promise.resolve(r);for(const a of[e,...i]){if(a.isDisposed())continue;const d=a.findMatches(o.word,!0,!1,!0,d4,!1).map(h=>({range:h.range,kind:TS.Text}));d&&r.set(a.uri,d)}return r}}let WQ=class extends re{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new ype)),this._register(e.multiDocumentHighlightProvider.register("*",new ype))}};WQ=ght([pht(0,nt)],WQ);var Oxe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},PF=function(s,e){return function(t,i){e(t,i,s)}},us,VQ;const Yne=new qe("hasWordHighlights",!1);function Axe(s,e,t,i){const n=s.ordered(e);return Oee(n.map(r=>()=>Promise.resolve(r.provideDocumentHighlights(e,t,i)).then(void 0,ns)),r=>r!=null).then(r=>{if(r){const o=new dr;return o.set(e.uri,r),o}return new dr})}function mht(s,e,t,i,n,r){const o=s.ordered(e);return Oee(o.map(a=>()=>{const l=r.filter(d=>tCe(d)).filter(d=>ste(a.selector,d.uri,d.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,l,n)).then(void 0,ns)}),a=>a!=null)}class Fxe{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=Xs(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new W(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const n=t.startLineNumber,r=t.startColumn,o=t.endColumn,a=this._getCurrentWordRange(e,t);let l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let d=0,h=i.length;!l&&d<h;d++){const f=i.getRange(d);f&&f.startLineNumber===n&&f.startColumn<=r&&f.endColumn>=o&&(l=!0)}return l}cancel(){this.result.cancel()}}class _ht extends Fxe{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return Axe(this._providers,e,t.getPosition(),n).then(r=>r||new dr)}}class vht extends Fxe{constructor(e,t,i,n,r){super(e,t,i),this._providers=n,this._otherModels=r}_compute(e,t,i,n){return mht(this._providers,e,t.getPosition(),i,n,this._otherModels).then(r=>r||new dr)}}function bht(s,e,t,i,n){return new _ht(e,t,n,s)}function Cht(s,e,t,i,n,r){return new vht(e,t,n,s,r)}Ea("_executeDocumentHighlights",async(s,e,t)=>{const i=s.get(nt),n=await Axe(i.documentHighlightProvider,e,t,zt.None);return n==null?void 0:n.get(e.uri)});var Ym;let HQ=(Ym=class{constructor(e,t,i,n,r){this.toUnhook=new me,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new dr,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.runDelayer=this.toUnhook.add(new Ac(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=r,this._hasWordHighlights=Yne.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(81),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(o=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this.runDelayer.trigger(()=>{this._onPositionChanged(o)})})),this.toUnhook.add(e.onDidFocusEditorText(o=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}))})),this.toUnhook.add(e.onDidChangeModelContent(o=>{wV(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(o=>{!o.newModelUrl&&o.oldModelUrl?this._stopSingular():us.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(o=>{var l,d;const a=this.editor.getOption(81);if(this.occurrencesHighlight!==a)switch(this.occurrencesHighlight=a,a){case"off":this._stopAll();break;case"singleFile":this._stopAll((d=(l=us.query)==null?void 0:l.modelInfo)==null?void 0:d.model);break;case"multiFile":us.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",a);break}})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,us.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&(this.runDelayer.cancel(),this._run())}_getSortedHighlights(){return this.decorations.getRanges().sort(W.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(r=>r.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const r=this._getWord();if(r){const o=this.editor.getModel().getLineContent(n.startLineNumber);Jo(`${o}, ${i+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(r=>r.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const r=this._getWord();if(r){const o=this.editor.getModel().getLineContent(n.startLineNumber);Jo(`${o}, ${i+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=us.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),us.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),i=[];for(const n of t){if(!n.hasModel()||qE(n.getModel().uri,e==null?void 0:e.uri))continue;const r=us.storedDecorationIDs.get(n.getModel().uri);if(!r)continue;n.removeDecorations(r),i.push(n.getModel().uri);const o=y_.get(n);o!=null&&o.wordHighlighter&&o.wordHighlighter.decorations.length>0&&(o.wordHighlighter.decorations.clear(),o.wordHighlighter.workerRequest=null,o.wordHighlighter._hasWordHighlights.set(!1))}for(const n of i)us.storedDecorationIDs.delete(n)}_stopSingular(){var e,t,i,n;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())==null?void 0:e.uri.scheme)!==Rt.vscodeNotebookCell&&((i=(t=us.query)==null?void 0:t.modelInfo)==null?void 0:i.model.uri.scheme)!==Rt.vscodeNotebookCell?(us.query=null,this._run()):(n=us.query)!=null&&n.modelInfo&&(us.query.modelInfo=null)),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(e){this._removeAllDecorations(e),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){var t;if(this.occurrencesHighlight==="off"){this._stopAll();return}if(e.reason!==3&&((t=this.editor.getModel())==null?void 0:t.uri.scheme)!==Rt.vscodeNotebookCell){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===Rt.vscodeNotebookCell){const r=[],o=this.codeEditorService.listCodeEditors();for(const a of o){const l=a.getModel();l&&l!==e&&l.uri.scheme===Rt.vscodeNotebookCell&&r.push(l)}return r}const i=[],n=this.codeEditorService.listCodeEditors();for(const r of n){if(!tne(r))continue;const o=r.getModel();o&&e===o.modified&&i.push(o.modified)}if(i.length)return i;if(this.occurrencesHighlight==="singleFile")return[];for(const r of n){const o=r.getModel();o&&o!==e&&i.push(o)}return i}_run(e){var n,r;let t;if(this.editor.hasTextFocus()){const o=this.editor.getSelection();if(!o||o.startLineNumber!==o.endLineNumber){us.query=null,this._stopAll();return}const a=o.startColumn,l=o.endColumn,d=this._getWord();if(!d||d.startColumn>a||d.endColumn<l){us.query=null,this._stopAll();return}t=this.workerRequest&&this.workerRequest.isValid(this.model,o,this.decorations),us.query={modelInfo:{model:this.model,selection:o},word:d}}else if(!us.query){this._stopAll();return}if(this.lastCursorPositionChangeTime=new Date().getTime(),t)this.workerRequestCompleted&&this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else if(qE(this.editor.getModel().uri,(n=us.query.modelInfo)==null?void 0:n.model.uri)){if(!e){const l=this.decorations.getRanges();for(const d of l)if(d.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model:void 0);const o=++this.workerRequestTokenId;this.workerRequestCompleted=!1;const a=this.getOtherModelsToHighlight(this.editor.getModel());if(!us.query||!us.query.modelInfo||us.query.modelInfo.model.isDisposed())return;this.workerRequest=this.computeWithModel(us.query.modelInfo.model,us.query.modelInfo.selection,us.query.word,a),(r=this.workerRequest)==null||r.result.then(l=>{o===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=l||[],this._beginRenderDecorations())},Nt)}}computeWithModel(e,t,i,n){return n.length?Cht(this.multiDocumentProviders,e,t,i,this.editor.getOption(132),n):bht(this.providers,e,t,i,this.editor.getOption(132))}_beginRenderDecorations(){const e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){var t,i,n;this.renderDecorationsTimer=-1;const e=this.codeEditorService.listCodeEditors();for(const r of e){const o=y_.get(r);if(!o)continue;const a=[],l=(t=r.getModel())==null?void 0:t.uri;if(l&&this.workerRequestValue.has(l)){const d=us.storedDecorationIDs.get(l),h=this.workerRequestValue.get(l);if(h)for(const p of h)p.range&&a.push({range:p.range,options:ldt(p.kind)});let f=[];r.changeDecorations(p=>{f=p.deltaDecorations(d??[],a)}),us.storedDecorationIDs=us.storedDecorationIDs.set(l,f),a.length>0&&((i=o.wordHighlighter)==null||i.decorations.set(a),(n=o.wordHighlighter)==null||n._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}},us=Ym,Ym.storedDecorationIDs=new dr,Ym.query=null,Ym);HQ=us=Oxe([PF(4,wi)],HQ);var BC;let y_=(BC=class extends re{static get(e){return e.getContribution(VQ.ID)}constructor(e,t,i,n){super(),this._wordHighlighter=null;const r=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new HQ(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,n))};this._register(e.onDidChangeModel(o=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),r()})),r()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)==null||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)==null||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},VQ=BC,BC.ID="editor.contrib.wordHighlighter",BC);y_=VQ=Oxe([PF(1,wt),PF(2,nt),PF(3,wi)],y_);class Bxe extends Xe{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=y_.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class yht extends Bxe{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:w("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:Yne,kbOpts:{kbExpr:U.editorTextFocus,primary:65,weight:100}})}}class wht extends Bxe{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:w("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:Yne,kbOpts:{kbExpr:U.editorTextFocus,primary:1089,weight:100}})}}class Sht extends Xe{constructor(){super({id:"editor.action.wordHighlight.trigger",label:w("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:void 0,kbOpts:{kbExpr:U.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=y_.get(t);n&&n.restoreViewState(!0)}}pi(y_.ID,y_,0);Pe(yht);Pe(wht);Pe(Sht);Ux(WQ);class e7 extends zs{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=Bc(t.getOption(132),t.getOption(131)),r=t.getModel(),o=t.getSelections(),a=o.length>1,l=o.map(d=>{const h=new ie(d.positionLineNumber,d.positionColumn),f=this._move(n,r,h,this._wordNavigationType,a);return this._moveTo(d,f,this._inSelectionMode)});if(r.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,l.map(d=>Ci.fromModelSelection(d))),l.length===1){const d=new ie(l[0].positionLineNumber,l[0].positionColumn);t.revealPosition(d,0)}}_moveTo(e,t,i){return i?new lt(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new lt(t.lineNumber,t.column,t.lineNumber,t.column)}}class R_ extends e7{_move(e,t,i,n,r){return Ni.moveWordLeft(e,t,i,n,r)}}class P_ extends e7{_move(e,t,i,n,r){return Ni.moveWordRight(e,t,i,n)}}class xht extends R_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class kht extends R_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class Lht extends R_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:ve.and(U.textInputFocus,(e=ve.and(xN,gH))==null?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class Dht extends R_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class Iht extends R_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class Eht extends R_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:ve.and(U.textInputFocus,(e=ve.and(xN,gH))==null?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class Tht extends R_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n,r){return super._move(Bc(ju.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class Nht extends R_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n,r){return super._move(Bc(ju.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class Mht extends P_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class Rht extends P_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:ve.and(U.textInputFocus,(e=ve.and(xN,gH))==null?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class Pht extends P_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class Oht extends P_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class Aht extends P_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:ve.and(U.textInputFocus,(e=ve.and(xN,gH))==null?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class Fht extends P_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class Bht extends P_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n,r){return super._move(Bc(ju.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class Wht extends P_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n,r){return super._move(Bc(ju.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,r)}}class t7 extends zs{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e.get(Vn);if(!t.hasModel())return;const r=Bc(t.getOption(132),t.getOption(131)),o=t.getModel(),a=t.getSelections(),l=t.getOption(6),d=t.getOption(11),h=n.getLanguageConfiguration(o.getLanguageId()).getAutoClosingPairs(),f=t._getViewModel(),p=a.map(m=>{const v=this._delete({wordSeparators:r,model:o,selection:m,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:d,autoClosingPairs:h,autoClosedCharacters:f.getCursorAutoClosedCharacters()},this._wordNavigationType);return new zr(v,"")});t.pushUndoStop(),t.executeCommands(this.id,p),t.pushUndoStop()}}class Zne extends t7{_delete(e,t){const i=Ni.deleteWordLeft(e,t);return i||new W(1,1,1,1)}}class Xne extends t7{_delete(e,t){const i=Ni.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),r=e.model.getLineMaxColumn(n);return new W(n,r,n,r)}}class Vht extends Zne{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:U.writable})}}class Hht extends Zne{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:U.writable})}}class $ht extends Zne{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class zht extends Xne{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:U.writable})}}class jht extends Xne{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:U.writable})}}class Uht extends Xne{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class qht extends Xe{constructor(){super({id:"deleteInsideWord",precondition:U.writable,label:w("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const n=Bc(t.getOption(132),t.getOption(131)),r=t.getModel(),a=t.getSelections().map(l=>{const d=Ni.deleteInsideWord(n,r,l);return new zr(d,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}Ue(new xht);Ue(new kht);Ue(new Lht);Ue(new Dht);Ue(new Iht);Ue(new Eht);Ue(new Mht);Ue(new Rht);Ue(new Pht);Ue(new Oht);Ue(new Aht);Ue(new Fht);Ue(new Tht);Ue(new Nht);Ue(new Bht);Ue(new Wht);Ue(new Vht);Ue(new Hht);Ue(new $ht);Ue(new zht);Ue(new jht);Ue(new Uht);Pe(qht);class Kht extends t7{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=kH.deleteWordPartLeft(e);return i||new W(1,1,1,1)}}class Ght extends t7{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:U.writable,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=kH.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),r=e.model.getLineMaxColumn(n);return new W(n,r,n,r)}}class Wxe extends e7{_move(e,t,i,n,r){return kH.moveWordPartLeft(e,t,i,r)}}class Yht extends Wxe{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}fi.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class Zht extends Wxe{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}fi.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class Vxe extends e7{_move(e,t,i,n,r){return kH.moveWordPartRight(e,t,i)}}class Xht extends Vxe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class Qht extends Vxe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:U.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}Ue(new Kht);Ue(new Ght);Ue(new Yht);Ue(new Zht);Ue(new Xht);Ue(new Qht);const rse=class rse extends re{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=al.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(93);t||(this.editor.isSimpleWidget?t=new io(w("editor.simple.readonly","Cannot edit in read-only input")):t=new io(w("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};rse.ID="editor.contrib.readOnlyMessageController";let rB=rse;pi(rB.ID,rB,2);var Jht=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},wpe=function(s,e){return function(t,i){e(t,i,s)}};let $Q=class extends re{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=Kt(this,void 0);const n=$r("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),r=$r("_textModel.onDidChangeContent",We.debounce(o=>this._textModel.onDidChangeContent(o),()=>{},100));this._register(wa(async(o,a)=>{n.read(o),r.read(o);const l=a.add(new WQe),d=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(d,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter(r=>e.contains(r.range.startLineNumber)&&!e.contains(r.range.endLineNumber));return n.sort(bve(Ko(r=>r.range.endLineNumber-r.range.startLineNumber,kd))),n.map(r=>({name:r.name,kind:r.kind,startLineNumber:r.range.startLineNumber}))}};$Q=Jht([wpe(1,nt),wpe(2,ZN)],$Q);n3.setBreadcrumbsSourceFactory((s,e)=>e.createInstance($Q,s));const ose=class ose extends re{constructor(e){super(),this.editor=e,this.widget=null,Ru&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(92);!this.widget&&e?this.widget=new zQ(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};ose.ID="editor.contrib.iPadShowKeyboard";let oB=ose;const WW=class WW extends re{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(ue(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(ue(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return WW.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}};WW.ID="editor.contrib.ShowKeyboardWidget";let zQ=WW;pi(oB.ID,oB,3);var eft=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Spe=function(s,e){return function(t,i){e(t,i,s)}},jQ,WC;let YT=(WC=class extends re{static get(e){return e.getContribution(jQ.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(n=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(n=>this.stop())),this._register(qn.onDidChange(n=>this.stop())),this._register(this._editor.onKeyUp(n=>n.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new UQ(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}},jQ=WC,WC.ID="editor.contrib.inspectTokens",WC);YT=jQ=eft([Spe(1,ac),Spe(2,Rn)],YT);class tft extends Xe{constructor(){super({id:"editor.action.inspectTokens",label:QK.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=YT.get(t);i==null||i.launch()}}function ift(s){let e="";for(let t=0,i=s.length;t<i;t++){const n=s.charCodeAt(t);switch(n){case 9:e+="→";break;case 32:e+="·";break;default:e+=String.fromCharCode(n)}}return e}function nft(s,e){const t=qn.get(e);if(t)return t;const i=s.encodeLanguageId(e);return{getInitialState:()=>$S,tokenize:(n,r,o)=>Dte(e,o),tokenizeEncoded:(n,r,o)=>sH(i,o)}}const VW=class VW extends re{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=nft(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return VW._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let l=t.tokens1.length-1;l>=0;l--){const d=t.tokens1[l];if(e.column-1>=d.offset){i=l;break}}let n=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){n=l;break}const r=this._model.getLineContent(e.lineNumber);let o="";if(i<t.tokens1.length){const l=t.tokens1[i].offset,d=i+1<t.tokens1.length?t.tokens1[i+1].offset:r.length;o=r.substring(l,d)}Lr(this._domNode,Fe("h2.tm-token",void 0,ift(o),Fe("span.tm-token-length",void 0,`${o.length} ${o.length===1?"char":"chars"}`))),Ie(this._domNode,Fe("hr.tokens-inspect-separator",{style:"clear:both"}));const a=(n<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(n<<1)+1]):null;Ie(this._domNode,Fe("table.tm-metadata-table",void 0,Fe("tbody",void 0,Fe("tr",void 0,Fe("td.tm-metadata-key",void 0,"language"),Fe("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),Fe("tr",void 0,Fe("td.tm-metadata-key",void 0,"token type"),Fe("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),Fe("tr",void 0,Fe("td.tm-metadata-key",void 0,"font style"),Fe("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),Fe("tr",void 0,Fe("td.tm-metadata-key",void 0,"foreground"),Fe("td.tm-metadata-value",void 0,`${a?be.Format.CSS.formatHex(a.foreground):"-?-"}`)),Fe("tr",void 0,Fe("td.tm-metadata-key",void 0,"background"),Fe("td.tm-metadata-value",void 0,`${a?be.Format.CSS.formatHex(a.background):"-?-"}`))))),Ie(this._domNode,Fe("hr.tokens-inspect-separator")),i<t.tokens1.length&&Ie(this._domNode,Fe("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=qn.getColorMap(),i=ma.getLanguageId(e),n=ma.getTokenType(e),r=ma.getFontStyle(e),o=ma.getForeground(e),a=ma.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:n,fontStyle:r,foreground:t[o],background:t[a]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),e&8&&(t+="strikethrough "),t.length===0&&(t="---"),t}_getTokensAtLine(e){const t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),n=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:i.tokens,tokens2:n.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}};VW._ID="editor.contrib.inspectTokensWidget";let UQ=VW;pi(YT.ID,YT,4);Pe(tft);var sft=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},xpe=function(s,e){return function(t,i){e(t,i,s)}},eI,VC;let qQ=(VC=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=Wn.as(Wy.Quickaccess)}provide(e){const t=new me;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const n=this.registry.getQuickAccessProvider(i.substr(eI.PREFIX.length));n&&n.prefix&&n.prefix!==eI.PREFIX&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==eI.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,n=i||"…";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:w("helpPickAriaLabel","{0}, {1}",n,t.description),description:t.description}})}},eI=VC,VC.PREFIX="?",VC);qQ=eI=sft([xpe(0,Uc),xpe(1,Ri)],qQ);Wn.as(Wy.Quickaccess).registerQuickAccessProvider({ctor:qQ,prefix:"",helpEntries:[{description:JK.helpQuickAccessActionLabel}]});class Hxe{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){var o;const n=new me;e.canAcceptInBackground=!!((o=this.options)!=null&&o.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const r=n.add(new er);return r.value=this.doProvide(e,t,i),n.add(this.onDidActiveTextEditorControlChange(()=>{r.value=void 0,r.value=this.doProvide(e,t)})),n}doProvide(e,t,i){const n=new me,r=this.activeTextEditorControl;if(r&&this.canProvideWithTextEditor(r)){const o={editor:r},a=Y1e(r);if(a){let l=r.saveViewState()??void 0;n.add(a.onDidChangeCursorPosition(()=>{l=r.saveViewState()??void 0})),o.restoreViewState=()=>{l&&r===this.activeTextEditorControl&&r.restoreViewState(l)},n.add(t_(t.onCancellationRequested)(()=>{var d;return(d=o.restoreViewState)==null?void 0:d.call(o)}))}n.add(ut(()=>this.clearDecorations(r))),n.add(this.provideWithTextEditor(o,e,t,i))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&ef(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return tne(e)?(t=e.getModel())==null?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const n=[];this.rangeHighlightDecorationId&&(n.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),n.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const r=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:Kn(Vye),position:Gl.Full}}}],[o,a]=i.deltaDecorations(n,r);this.rangeHighlightDecorationId={rangeHighlightId:o,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const HW=class HW extends Hxe{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=w("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,re.None}provideWithTextEditor(e,t,i){const n=e.editor,r=new me;r.add(t.onDidAccept(l=>{const[d]=t.selectedItems;if(d){if(!this.isValidLineNumber(n,d.lineNumber))return;this.gotoLocation(e,{range:this.toRange(d.lineNumber,d.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const o=()=>{const l=this.parsePosition(n,t.value.trim().substr(HW.PREFIX.length)),d=this.getPickLabel(n,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:d}],t.ariaLabel=d,!this.isValidLineNumber(n,l.lineNumber)){this.clearDecorations(n);return}const h=this.toRange(l.lineNumber,l.column);n.revealRangeInCenter(h,0),this.addDecorations(n,h)};o(),r.add(t.onDidChangeValue(()=>o()));const a=Y1e(n);return a&&a.getOptions().get(68).renderType===2&&(a.updateOptions({lineNumbers:"on"}),r.add(ut(()=>a.updateOptions({lineNumbers:"relative"})))),r}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(r=>parseInt(r,10)).filter(r=>!isNaN(r)),n=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:n+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?w("gotoLineColumnLabel","Go to line {0} and character {1}.",t,i):w("gotoLineLabel","Go to line {0}.",t);const n=e.getPosition()||{lineNumber:1,column:1},r=this.lineCount(e);return r>1?w("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",n.lineNumber,n.column,r):w("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",n.lineNumber,n.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||typeof i!="number")return!1;const n=this.getModel(e);if(!n)return!1;const r={lineNumber:t,column:i};return n.validatePosition(r).equals(r)}lineCount(e){var t;return((t=this.getModel(e))==null?void 0:t.getLineCount())??0}};HW.PREFIX=":";let KQ=HW;var rft=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},oft=function(s,e){return function(t,i){e(t,i,s)}};let ZT=class extends KQ{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=We.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};ZT=rft([oft(0,wi)],ZT);var HC;let $xe=(HC=class extends Xe{constructor(){super({id:HC.ID,label:Q4.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:U.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Uc).quickAccess.show(ZT.PREFIX)}},HC.ID="editor.action.gotoLine",HC);Pe($xe);Wn.as(Wy.Quickaccess).registerQuickAccessProvider({ctor:ZT,prefix:ZT.PREFIX,helpEntries:[{description:Q4.gotoLineActionLabel,commandId:$xe.ID}]});const zxe=[void 0,[]];function Fj(s,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?aft(s,n.values,t,i):jxe(s,e,t,i)}function aft(s,e,t,i){let n=0;const r=[];for(const o of e){const[a,l]=jxe(s,o,t,i);if(typeof a!="number")return zxe;n+=a,r.push(...l)}return[n,lft(r)]}function jxe(s,e,t,i){const n=ny(e.original,e.originalLowercase,t,s,s.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?[n[0],SN(n)]:zxe}function lft(s){const e=s.sort((n,r)=>n.start-r.start),t=[];let i;for(const n of e)!i||!cft(i,n)?(i=n,t.push(n)):(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end));return t}function cft(s,e){return!(s.end<e.start||e.end<s.start)}function kpe(s){return s.startsWith('"')&&s.endsWith('"')}const Uxe=" ";function GQ(s){typeof s!="string"&&(s="");const e=s.toLowerCase(),{pathNormalized:t,normalized:i,normalizedLowercase:n}=Lpe(s),r=t.indexOf(Lu)>=0,o=kpe(s);let a;const l=s.split(Uxe);if(l.length>1)for(const d of l){const h=kpe(d),{pathNormalized:f,normalized:p,normalizedLowercase:m}=Lpe(d);p&&(a||(a=[]),a.push({original:d,originalLowercase:d.toLowerCase(),pathNormalized:f,normalized:p,normalizedLowercase:m,expectContiguousMatch:h}))}return{original:s,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:n,values:a,containsPathSeparator:r,expectContiguousMatch:o}}function Lpe(s){let e;Kr?e=s.replace(/\//g,Lu):e=s.replace(/\\/g,Lu);const t=C3e(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function Dpe(s){return Array.isArray(s)?GQ(s.map(e=>e.original).join(Uxe)):GQ(s.original)}var dft=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Ipe=function(s,e){return function(t,i){e(t,i,s)}},OF,vu;let Ub=(vu=class extends Hxe{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,w("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),re.None}provideWithTextEditor(e,t,i,n){const r=e.editor,o=this.getModel(r);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,t,i,n):this.doProvideWithoutEditorSymbols(e,o,t,i):re.None}doProvideWithoutEditorSymbols(e,t,i,n){const r=new me;return this.provideLabelPick(i,w("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,r)||n.isCancellationRequested||r.add(this.doProvideWithEditorSymbols(e,t,i,n)))(),r}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new Ix,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))}));return t.add(ut(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,n,r){var f;const o=e.editor,a=new me;a.add(i.onDidAccept(p=>{var v;const[m]=i.selectedItems;m&&m.range&&(this.gotoLocation(e,{range:m.range.selection,keyMods:i.keyMods,preserveFocus:p.inBackground}),(v=r==null?void 0:r.handleAccept)==null||v.call(r,m),p.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:p})=>{p&&p.range&&(this.gotoLocation(e,{range:p.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const l=this.getDocumentSymbols(t,n);let d;const h=async p=>{d==null||d.dispose(!0),i.busy=!1,d=new Bn(n),i.busy=!0;try{const m=GQ(i.value.substr(OF.PREFIX.length).trim()),v=await this.doGetSymbolPicks(l,m,void 0,d.token,t);if(n.isCancellationRequested)return;if(v.length>0){if(i.items=v,p&&m.original.length===0){const b=ME(v,y=>!!(y.type!=="separator"&&y.range&&W.containsPosition(y.range.decoration,p)));b&&(i.activeItems=[b])}}else m.original.length>0?this.provideLabelPick(i,w("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(i,w("noSymbolResults","No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>h(void 0))),h((f=o.getSelection())==null?void 0:f.getPosition()),a.add(i.onDidChangeActive(()=>{const[p]=i.activeItems;p&&p.range&&(o.revealRangeInCenter(p.range.selection,0),this.addDecorations(o,p.range.decoration))})),a}async doGetSymbolPicks(e,t,i,n,r){var y,x;const o=await e;if(n.isCancellationRequested)return[];const a=t.original.indexOf(OF.SCOPE_PREFIX)===0,l=a?1:0;let d,h;t.values&&t.values.length>1?(d=Dpe(t.values[0]),h=Dpe(t.values.slice(1))):d=t;let f;const p=(x=(y=this.options)==null?void 0:y.openSideBySideDirection)==null?void 0:x.call(y);p&&(f=[{iconClass:p==="right"?Ct.asClassName(Oe.splitHorizontal):Ct.asClassName(Oe.splitVertical),tooltip:p==="right"?w("openToSide","Open to the Side"):w("openToBottom","Open to the Bottom")}]);const m=[];for(let D=0;D<o.length;D++){const S=o[D],I=v3e(S.name),E=`$(${m4.toIcon(S.kind).id}) ${I}`,R=E.length-I.length;let M=S.containerName;i!=null&&i.extraContainerLabel&&(M?M=`${i.extraContainerLabel} • ${M}`:M=i.extraContainerLabel);let O,V,te,J;if(t.original.length>l){let H=!1;if(d!==t&&([O,V]=Fj(E,{...t,values:void 0},l,R),typeof O=="number"&&(H=!0)),typeof O!="number"&&([O,V]=Fj(E,d,l,R),typeof O!="number"))continue;if(!H&&h){if(M&&h.original.length>0&&([te,J]=Fj(M,h)),typeof te!="number")continue;typeof O=="number"&&(O+=te)}}const z=S.tags&&S.tags.indexOf(1)>=0;m.push({index:D,kind:S.kind,score:O,label:E,ariaLabel:u3e(S.name,S.kind),description:M,highlights:z?void 0:{label:V,description:J},range:{selection:W.collapseToStart(S.selectionRange),decoration:S.range},uri:r.uri,symbolName:I,strikethrough:z,buttons:f})}const v=m.sort((D,S)=>a?this.compareByKindAndScore(D,S):this.compareByScore(D,S));let b=[];if(a){let E=function(){S&&typeof D=="number"&&I>0&&(S.label=YC(Wj[D]||Bj,I))},D,S,I=0;for(const R of v)D!==R.kind?(E(),D=R.kind,I=1,S={type:"separator"},b.push(S)):I++,b.push(R);E()}else v.length>0&&(b=[{label:w("symbols","symbols ({0})",m.length),type:"separator"},...v]);return b}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const i=Wj[e.kind]||Bj,n=Wj[t.kind]||Bj,r=i.localeCompare(n);return r===0?this.compareByScore(e,t):r}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},OF=vu,vu.PREFIX="@",vu.SCOPE_PREFIX=":",vu.PREFIX_BY_CATEGORY=`${vu.PREFIX}${vu.SCOPE_PREFIX}`,vu);Ub=OF=dft([Ipe(0,nt),Ipe(1,ZN)],Ub);const Bj=w("property","properties ({0})"),Wj={5:w("method","methods ({0})"),11:w("function","functions ({0})"),8:w("_constructor","constructors ({0})"),12:w("variable","variables ({0})"),4:w("class","classes ({0})"),22:w("struct","structs ({0})"),23:w("event","events ({0})"),24:w("operator","operators ({0})"),10:w("interface","interfaces ({0})"),2:w("namespace","namespaces ({0})"),3:w("package","packages ({0})"),25:w("typeParameter","type parameters ({0})"),1:w("modules","modules ({0})"),6:w("property","properties ({0})"),9:w("enum","enumerations ({0})"),21:w("enumMember","enumeration members ({0})"),14:w("string","strings ({0})"),0:w("file","files ({0})"),17:w("array","arrays ({0})"),15:w("number","numbers ({0})"),16:w("boolean","booleans ({0})"),18:w("object","objects ({0})"),19:w("key","keys ({0})"),7:w("field","fields ({0})"),13:w("constant","constants ({0})")};var uft=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},Vj=function(s,e){return function(t,i){e(t,i,s)}};let YQ=class extends Ub{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=We.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};YQ=uft([Vj(0,wi),Vj(1,nt),Vj(2,ZN)],YQ);const $W=class $W extends Xe{constructor(){super({id:$W.ID,label:GE.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:U.hasDocumentSymbolProvider,kbOpts:{kbExpr:U.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Uc).quickAccess.show(Ub.PREFIX,{itemActivation:cu.NONE})}};$W.ID="editor.action.quickOutline";let aB=$W;Pe(aB);Wn.as(Wy.Quickaccess).registerQuickAccessProvider({ctor:YQ,prefix:Ub.PREFIX,helpEntries:[{description:GE.quickOutlineActionLabel,prefix:Ub.PREFIX,commandId:aB.ID},{description:GE.quickOutlineByCategoryActionLabel,prefix:Ub.PREFIX_BY_CATEGORY}]});function hft(s){const e=new Map;for(const t of s)e.set(t,(e.get(t)??0)+1);return e}class zI{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,r=[];for(const[o,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const d=this.computeSimilarityScore(l,i,n);d>0&&r.push({key:o,score:d})}}return r}static termFrequencies(e){return hft(zI.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(i);const n=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(n.length>1)for(const r of n)r.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(r)&&(yield t(r))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const n of t.textChunks){const r=zI.termFrequencies(n);for(const o of r.keys())this.chunkOccurrences.set(o,(this.chunkOccurrences.get(o)??0)+1);i.push({text:n,tf:r})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const n of i.tf.keys()){const r=this.chunkOccurrences.get(n);if(typeof r=="number"){const o=r-1;o<=0?this.chunkOccurrences.delete(n):this.chunkOccurrences.set(n,o)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[r,o]of Object.entries(t)){const a=e.tf.get(r);if(!a)continue;let l=i.get(r);typeof l!="number"&&(l=this.computeIdf(r),i.set(r,l));const d=a*l;n+=d*o}return n}computeEmbedding(e){const t=zI.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const r=this.computeIdf(i);r>0&&(t[i]=n*r)}return t}}function fft(s){var i;const e=s.slice(0);e.sort((n,r)=>r.score-n.score);const t=((i=e[0])==null?void 0:i.score)??0;if(t>0)for(const n of e)n.score/=t;return e}var x0;(function(s){s[s.NO_ACTION=0]="NO_ACTION",s[s.CLOSE_PICKER=1]="CLOSE_PICKER",s[s.REFRESH_PICKER=2]="REFRESH_PICKER",s[s.REMOVE_ITEM=3]="REMOVE_ITEM"})(x0||(x0={}));function Hj(s){const e=s;return Array.isArray(e.items)}function Epe(s){const e=s;return!!e.picks&&e.additionalPicks instanceof Promise}class gft extends re{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var d;const n=new me;e.canAcceptInBackground=!!((d=this.options)!=null&&d.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let r;const o=n.add(new er),a=async()=>{var y;const h=o.value=new me;r==null||r.dispose(!0),e.busy=!1,r=new Bn(t);const f=r.token;let p=e.value.substring(this.prefix.length);(y=this.options)!=null&&y.shouldSkipTrimPickFilter||(p=p.trim());const m=this._getPicks(p,h,f,i),v=(x,D)=>{var E;let S,I;if(Hj(x)?(S=x.items,I=x.active):S=x,S.length===0){if(D)return!1;(p.length>0||e.hideInput)&&((E=this.options)!=null&&E.noResultsPick)&&(bE(this.options.noResultsPick)?S=[this.options.noResultsPick(p)]:S=[this.options.noResultsPick])}return e.items=S,I&&(e.activeItems=[I]),!0},b=async x=>{let D=!1,S=!1;await Promise.all([(async()=>{typeof x.mergeDelay=="number"&&(await Og(x.mergeDelay),f.isCancellationRequested)||S||(D=v(x.picks,!0))})(),(async()=>{e.busy=!0;try{const I=await x.additionalPicks;if(f.isCancellationRequested)return;let E,R;Hj(x.picks)?(E=x.picks.items,R=x.picks.active):E=x.picks;let M,O;if(Hj(I)?(M=I.items,O=I.active):M=I,M.length>0||!D){let V;if(!R&&!O){const te=e.activeItems[0];te&&E.indexOf(te)!==-1&&(V=te)}v({items:[...E,...M],active:R||O||V})}}finally{f.isCancellationRequested||(e.busy=!1),S=!0}})()])};if(m!==null)if(Epe(m))await b(m);else if(!(m instanceof Promise))v(m);else{e.busy=!0;try{const x=await m;if(f.isCancellationRequested)return;Epe(x)?await b(x):v(x)}finally{f.isCancellationRequested||(e.busy=!1)}}};n.add(e.onDidChangeValue(()=>a())),a(),n.add(e.onDidAccept(h=>{var p;if(i!=null&&i.handleAccept){h.inBackground||e.hide(),(p=i.handleAccept)==null||p.call(i,e.activeItems[0]);return}const[f]=e.selectedItems;typeof(f==null?void 0:f.accept)=="function"&&(h.inBackground||e.hide(),f.accept(e.keyMods,h))}));const l=async(h,f)=>{var m;if(typeof f.trigger!="function")return;const p=((m=f.buttons)==null?void 0:m.indexOf(h))??-1;if(p>=0){const v=f.trigger(p,e.keyMods),b=typeof v=="number"?v:await v;if(t.isCancellationRequested)return;switch(b){case x0.NO_ACTION:break;case x0.CLOSE_PICKER:e.hide();break;case x0.REFRESH_PICKER:a();break;case x0.REMOVE_ITEM:{const y=e.items.indexOf(f);if(y!==-1){const x=e.items.slice(),D=x.splice(y,1),S=e.activeItems.filter(E=>E!==D[0]),I=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=x,S&&(e.activeItems=S),e.keepScrollPosition=I}break}}}};return n.add(e.onDidTriggerItemButton(({button:h,item:f})=>l(h,f))),n.add(e.onDidTriggerSeparatorButton(({button:h,separator:f})=>l(h,f))),n}}var qxe=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},im=function(s,e){return function(t,i){e(t,i,s)}},Xv,Rs,Vh;let ZQ=(Vh=class extends gft{constructor(e,t,i,n,r,o){super(Xv.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=n,this.telemetryService=r,this.dialogService=o,this.commandsHistory=this._register(this.instantiationService.createInstance(XQ)),this.options=e}async _getPicks(e,t,i,n){var m,v;const r=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const o=t_(()=>{const b=new zI;b.updateDocuments(r.map(x=>({key:x.commandId,textChunks:[this.getTfIdfChunk(x)]})));const y=b.calculateScores(e,i);return fft(y).filter(x=>x.score>Xv.TFIDF_THRESHOLD).slice(0,Xv.TFIDF_MAX_RESULTS)}),a=[];for(const b of r){const y=Xv.WORD_FILTER(e,b.label)??void 0,x=b.commandAlias?Xv.WORD_FILTER(e,b.commandAlias)??void 0:void 0;if(y||x)b.highlights={label:y,detail:this.options.showAlias?x:void 0},a.push(b);else if(e===b.commandId)a.push(b);else if(e.length>=3){const D=o();if(i.isCancellationRequested)return[];const S=D.find(I=>I.key===b.commandId);S&&(b.tfIdfScore=S.score,a.push(b))}}const l=new Map;for(const b of a){const y=l.get(b.label);y?(b.description=b.commandId,y.description=y.commandId):l.set(b.label,b)}a.sort((b,y)=>{if(b.tfIdfScore&&y.tfIdfScore)return b.tfIdfScore===y.tfIdfScore?b.label.localeCompare(y.label):y.tfIdfScore-b.tfIdfScore;if(b.tfIdfScore)return 1;if(y.tfIdfScore)return-1;const x=this.commandsHistory.peek(b.commandId),D=this.commandsHistory.peek(y.commandId);if(x&&D)return x>D?-1:1;if(x)return-1;if(D)return 1;if(this.options.suggestedCommandIds){const S=this.options.suggestedCommandIds.has(b.commandId),I=this.options.suggestedCommandIds.has(y.commandId);if(S&&I)return 0;if(S)return-1;if(I)return 1}return b.label.localeCompare(y.label)});const d=[];let h=!1,f=!0,p=!!this.options.suggestedCommandIds;for(let b=0;b<a.length;b++){const y=a[b];b===0&&this.commandsHistory.peek(y.commandId)&&(d.push({type:"separator",label:w("recentlyUsed","recently used")}),h=!0),f&&y.tfIdfScore!==void 0&&(d.push({type:"separator",label:w("suggested","similar commands")}),f=!1),p&&y.tfIdfScore===void 0&&!this.commandsHistory.peek(y.commandId)&&((m=this.options.suggestedCommandIds)!=null&&m.has(y.commandId))&&(d.push({type:"separator",label:w("commonlyUsed","commonly used")}),h=!0,p=!1),h&&y.tfIdfScore===void 0&&!this.commandsHistory.peek(y.commandId)&&!((v=this.options.suggestedCommandIds)!=null&&v.has(y.commandId))&&(d.push({type:"separator",label:w("morecCommands","other commands")}),h=!1),d.push(this.toCommandPick(y,n))}return this.hasAdditionalCommandPicks(e,i)?{picks:d,additionalPicks:(async()=>{var x;const b=await this.getAdditionalCommandPicks(r,a,e,i);if(i.isCancellationRequested)return[];const y=b.map(D=>this.toCommandPick(D,n));return f&&((x=y[0])==null?void 0:x.type)!=="separator"&&y.unshift({type:"separator",label:w("suggested","similar commands")}),y})()}:d}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?w("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:n,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{var r;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(t==null?void 0:t.from)??"quick open"});try{(r=e.args)!=null&&r.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(o){zc(o)||this.dialogService.error(w("canNotRun","Command '{0}' resulted in an error",e.label),f3(o))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let n=e;return t&&t!==e&&(n+=` - ${t}`),i&&i.value!==e&&(n+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),n}},Xv=Vh,Vh.PREFIX=">",Vh.TFIDF_THRESHOLD=.5,Vh.TFIDF_MAX_RESULTS=5,Vh.WORD_FILTER=vte(jE,T8e,JCe),Vh);ZQ=Xv=qxe([im(1,ht),im(2,Ri),im(3,ln),im(4,oo),im(5,CN)],ZQ);var bu;let XQ=(bu=class extends re{constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===QE.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Rs.getConfiguredCommandHistoryLength(this.configurationService),Rs.cache&&Rs.cache.limit!==this.configuredCommandsHistoryLength&&(Rs.cache.limit=this.configuredCommandsHistoryLength,Rs.hasChanges=!0))}load(){const e=this.storageService.get(Rs.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(n){this.logService.error(`[CommandsHistory] invalid data: ${n}`)}const i=Rs.cache=new cf(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((r,o)=>r.value-o.value),n.forEach(r=>i.set(r.key,r.value))}Rs.counter=this.storageService.getNumber(Rs.PREF_KEY_COUNTER,0,Rs.counter)}push(e){Rs.cache&&(Rs.cache.set(e,Rs.counter++),Rs.hasChanges=!0)}peek(e){var t;return(t=Rs.cache)==null?void 0:t.peek(e)}saveState(){if(!Rs.cache||!Rs.hasChanges)return;const e={usesLRU:!0,entries:[]};Rs.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(Rs.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(Rs.PREF_KEY_COUNTER,Rs.counter,0,0),Rs.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var n,r;const i=(r=(n=e.getValue().workbench)==null?void 0:n.commandPalette)==null?void 0:r.history;return typeof i=="number"?i:Rs.DEFAULT_COMMANDS_HISTORY_LENGTH}},Rs=bu,bu.DEFAULT_COMMANDS_HISTORY_LENGTH=50,bu.PREF_KEY_CACHE="commandPalette.mru.cache",bu.PREF_KEY_COUNTER="commandPalette.mru.counter",bu.counter=1,bu.hasChanges=!1,bu);XQ=Rs=qxe([im(0,Wd),im(1,Gt),im(2,Gr)],XQ);class pft extends ZQ{constructor(e,t,i,n,r,o){super(e,t,i,n,r,o)}getCodeEditorCommandPicks(){var i;const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const n of e.getSupportedActions()){let r;(i=n.metadata)!=null&&i.description&&(Ize(n.metadata.description)?r=n.metadata.description:r={original:n.metadata.description,value:n.metadata.description}),t.push({commandId:n.id,commandAlias:n.alias,commandDescription:r,label:xte(n.label)||n.id})}return t}}var mft=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},H1=function(s,e){return function(t,i){e(t,i,s)}};let XT=class extends pft{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,i,n,r,o){super({showAlias:!1},e,i,n,r,o),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};XT=mft([H1(0,ht),H1(1,wi),H1(2,Ri),H1(3,ln),H1(4,oo),H1(5,CN)],XT);const zW=class zW extends Xe{constructor(){super({id:zW.ID,label:J4.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:U.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Uc).quickAccess.show(XT.PREFIX)}};zW.ID="editor.action.quickCommand";let lB=zW;Pe(lB);Wn.as(Wy.Quickaccess).registerQuickAccessProvider({ctor:XT,prefix:XT.PREFIX,helpEntries:[{description:J4.quickCommandHelp,commandId:lB.ID}]});var _ft=function(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r},$1=function(s,e){return function(t,i){e(t,i,s)}};let QQ=class extends _y{constructor(e,t,i,n,r,o,a){super(!0,e,t,i,n,r,o,a)}};QQ=_ft([$1(1,wt),$1(2,wi),$1(3,ps),$1(4,ht),$1(5,Wd),$1(6,Gt)],QQ);pi(_y.ID,QQ,4);class vft extends Xe{constructor(){super({id:"editor.action.toggleHighContrast",label:tG.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(ac),n=i.getColorTheme();Eu(n.type)?(i.setTheme(this._originalThemeName||(OS(n.type)?nS:ng)),this._originalThemeName=null):(i.setTheme(OS(n.type)?Wb:Vb),this._originalThemeName=n.themeName)}}Pe(vft);const bft={name:"Files",components:{FileTreeNode:e4e,CopyPathDialog:r4e},data(){return{browseResult:{current_path:"",parent_path:null,items:[]},selectedPath:"",selectedItem:null,fileContent:null,loading:!1,expandedPaths:new Set,openFiles:[],activeFile:null,fileLoading:!1,saving:!1,editor:null,originalContent:"",sidebarWidth:260,isResizing:!1,contextMenu:{visible:!1,x:0,y:0,target:null},inputDialog:{visible:!1,title:"",value:"",placeholder:"",type:"",target:null},fileIcons:{js:"fa-brands fa-js text-yellow-400",ts:"fa-brands fa-js text-blue-400",html:"fa-brands fa-html5 text-orange-500",css:"fa-brands fa-css3 text-blue-400",scss:"fa-brands fa-sass text-pink-400",json:"fa-solid fa-file-code text-yellow-300",yaml:"fa-solid fa-file-code text-blue-300",yml:"fa-solid fa-file-code text-blue-300",md:"fa-solid fa-file-lines text-gray-400",py:"fa-brands fa-python text-blue-500",vue:"fa-brands fa-vuejs text-green-400",sh:"fa-solid fa-terminal text-green-400",go:"fa-brands fa-golang text-cyan-400",rs:"fa-brands fa-rust text-orange-400"},uploadProgress:{visible:!1,percent:0,filename:"",cancelled:!1},downloadProgress:{visible:!1,percent:0,filename:"",cancelled:!1}}},computed:{fileTreeData(){return this.browseResult.items.map(e=>this.transformNode(e)).sort((e,t)=>e.is_directory===t.is_directory?e.name.localeCompare(t.name):e.is_directory?-1:1)},hasChanges(){return this.editor?this.editor.getValue()!==this.originalContent:!1},isBinaryFile(){var s;return(s=this.activeFile)==null?void 0:s.is_binary}},watch:{activeFile:{immediate:!0,handler(s){this.$nextTick(()=>{!this.editor&&this.$refs.editorContainer&&this.initEditor(),s&&this.editor?this.loadFileContent(s.path).then(e=>{const t=this.getLanguageFromFilename(s.name),i=$b.createModel(e,t);this.editor.setModel(i),this.originalContent=e}):this.editor&&(this.editor.setModel($b.createModel("","plaintext")),this.originalContent="")})}}},async created(){await this.browse(""),document.addEventListener("click",this.hideContextMenu),document.addEventListener("mousemove",this.handleResize),document.addEventListener("mouseup",this.stopResize)},activated(){!this.editor&&this.$refs.editorContainer&&this.initEditor()},beforeDestroy(){document.removeEventListener("click",this.hideContextMenu),document.removeEventListener("mousemove",this.handleResize),document.removeEventListener("mouseup",this.stopResize),this.editor&&(this.editor.dispose(),this.editor=null)},methods:{async browse(s){this.loading=!0;try{const e=await Yt.browseFilesystem(s);this.browseResult=e.data}catch(e){console.error("Browse failed:",e)}finally{this.loading=!1}},transformNode(s){return{name:s.name,path:s.path,is_directory:s.is_directory,is_drive:s.is_drive||!1,size:s.size,has_children:s.is_directory,expanded:!1,children:[]}},handleSelect(s){this.selectedPath=s.path,this.selectedItem=s},async openFile(s){var t;if(s.is_directory)return;const e=this.openFiles.find(i=>i.path===s.path);if(e){this.activeFile=e;return}this.fileLoading=!0;try{const i=await this.loadFileContent(s.path),n={name:s.name,path:s.path,is_binary:((t=this.fileContent)==null?void 0:t.is_binary)||!1};this.openFiles.push(n),this.activeFile=n}catch(i){console.error("Open file failed:",i)}finally{this.fileLoading=!1}},closeFile(s){var t;const e=this.openFiles.findIndex(i=>i.path===s.path);if(this.openFiles=this.openFiles.filter(i=>i.path!==s.path),((t=this.activeFile)==null?void 0:t.path)===s.path){const i=e>0?e-1:0;this.activeFile=this.openFiles.length>0?this.openFiles[Math.min(i,this.openFiles.length-1)]:null}},async saveFile(){if(!(!this.activeFile||!this.hasChanges)){this.saving=!0;try{const s=this.editor.getValue();await Yt.writeFile(this.activeFile.path,s),this.originalContent=s,this.$message.success("文件已保存")}catch(s){console.error("Save file failed:",s),this.$message.error("保存文件失败")}finally{this.saving=!1}}},async handleLoadChildren({path:s,callback:e}){try{const n=((await Yt.browseFilesystem(s)).data.items||[]).map(r=>this.transformNode(r)).sort((r,o)=>r.is_directory===o.is_directory?r.name.localeCompare(o.name):r.is_directory?-1:1);e(n)}catch(t){console.error("Load children failed:",t),e([])}},goUp(){this.browseResult.parent_path!==null&&this.browse(this.browseResult.parent_path===""?"":this.browseResult.parent_path)},goHome(){this.browse("")},refresh(){this.browse(this.browseResult.current_path||"")},async loadFileContent(s){var e;try{const t=await Yt.getFileContent(s);return this.fileContent=t.data||{content:"加载失败",is_binary:!1,size:0},((e=t.data)==null?void 0:e.content)||""}catch(t){return console.error("Load file content failed:",t),this.fileContent={content:"加载失败",is_binary:!1,size:0},""}},startResize(s){this.isResizing=!0,document.body.style.cursor="col-resize",document.body.style.userSelect="none"},handleResize(s){if(!this.isResizing)return;const e=s.clientX;e>=150&&e<=500&&(this.sidebarWidth=e)},stopResize(){this.isResizing=!1,document.body.style.cursor="",document.body.style.userSelect=""},showContextMenu(s,e){e&&(s.preventDefault(),this.contextMenu={visible:!0,x:s.pageX,y:s.pageY,target:e},this.selectedItem=e,this.selectedPath=e.path)},hideContextMenu(){this.contextMenu.visible=!1},async createNewFile(){this.hideContextMenu(),this.inputDialog={visible:!0,title:"新建文件",value:"",placeholder:"输入文件名",type:"file",target:this.contextMenu.target},this.$nextTick(()=>{var s;(s=this.$refs.renameInput)==null||s.focus()})},async createNewFolder(){this.hideContextMenu(),this.inputDialog={visible:!0,title:"新建文件夹",value:"",placeholder:"输入文件夹名",type:"folder",target:this.contextMenu.target},this.$nextTick(()=>{var s;(s=this.$refs.renameInput)==null||s.focus()})},copyPath(){this.hideContextMenu(),this.$refs.copyPathDialog.open(this.contextMenu.target.path)},renameItem(){this.hideContextMenu(),this.inputDialog={visible:!0,title:"重命名",value:this.contextMenu.target.name,placeholder:"输入新名称",type:"rename",target:this.contextMenu.target},this.$nextTick(()=>{var s,e;(s=this.$refs.renameInput)==null||s.focus(),(e=this.$refs.renameInput)==null||e.select()})},async confirmInput(){const{type:s,value:e,target:t}=this.inputDialog;if(!e.trim()){this.cancelInput();return}try{const i=t.path.includes("\\")?"\\":"/";if(s==="file"){const n=t.path+i+e.trim();await Yt.writeFile(n,"")}else if(s==="folder"){const n=t.path+i+e.trim();await Yt.createDirectory(n)}else if(s==="rename"){const r=t.path.substring(0,t.path.lastIndexOf(i))+i+e.trim();await Yt.renameFile(t.path,r)}this.refresh()}catch(i){console.error("Operation failed:",i),this.$message.error("操作失败")}this.inputDialog.visible=!1},cancelInput(){this.inputDialog.visible=!1},async deleteItem(){this.hideContextMenu();try{await this.$confirm(`确定要删除 "${this.contextMenu.target.name}" 吗?`,"确认删除",{confirmButtonText:"删除",cancelButtonText:"取消",type:"warning"}),await Yt.deleteFile(this.contextMenu.target.path),this.$message.success("删除成功"),this.refresh()}catch(s){s!=="cancel"&&(console.error("Delete failed:",s),this.$message.error("删除失败"))}},triggerFileUpload(){var s;this.hideContextMenu(),(s=this.$refs.fileInput)==null||s.click()},handleFileSelect(s){var i,n;const e=(i=s.target.files)==null?void 0:i[0];if(!e)return;const t=(n=this.contextMenu.target)==null?void 0:n.path;t&&(this.uploadFile(e,t),s.target.value="")},uploadFile(s,e){this.uploadProgress={visible:!0,percent:0,filename:s.name,cancelled:!1},Yt.uploadFilesystemWithProgress(e,s,t=>{this.uploadProgress.percent=t}).then(()=>{this.uploadProgress.visible=!1,this.$message.success("上传成功"),this.refresh()}).catch(t=>{this.uploadProgress.visible=!1,this.$message.error("上传失败: "+t.message)})},cancelUpload(){this.uploadProgress.cancelled=!0,this.uploadProgress.visible=!1},downloadFile(){this.hideContextMenu();const s=this.contextMenu.target;s&&(this.downloadProgress={visible:!0,percent:0,filename:s.name,cancelled:!1},Yt.downloadFilesystemWithProgress(s.path,s.name,e=>{this.downloadProgress.percent=e}).then(()=>{this.downloadProgress.visible=!1}).catch(e=>{this.downloadProgress.visible=!1,this.$message.error("下载失败: "+e.message)}))},cancelDownload(){this.downloadProgress.cancelled=!0,this.downloadProgress.visible=!1},initEditor(){this.editor||this.$refs.editorContainer&&(this.editor=$b.create(this.$refs.editorContainer,{value:"",language:"plaintext",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:14,fontFamily:'Consolas, Monaco, "Courier New", monospace',lineNumbers:"on",roundedSelection:!1,scrollbar:{useShadows:!1,verticalHasArrows:!1,horizontalHasArrows:!1,vertical:"auto",horizontal:"auto"}}),this.editor.onDidChangeModelContent(()=>{this.$forceUpdate()}),this.editor.addCommand(l3.CtrlCmd|a3.KeyS,()=>{this.saveFile()}))},getFileIcon(s){const e=s.split(".").pop().toLowerCase(),t=s.toLowerCase();return t==="dockerfile"?"fa-brands fa-docker text-blue-400":t===".gitignore"?"fa-brands fa-git text-red-400":t.startsWith("readme")?this.fileIcons.md:this.fileIcons[e]||"fa-solid fa-file text-gray-400"},getLanguageFromFilename(s){const e=s.split(".").pop().toLowerCase();return{js:"javascript",ts:"typescript",html:"html",css:"css",scss:"scss",vue:"html",py:"python",md:"markdown",json:"json",yaml:"yaml",yml:"yaml",xml:"xml",sql:"sql",sh:"shell",go:"go",rs:"rust"}[e]||"plaintext"}}};var Cft=function(){var i;var e=this,t=e._self._c;return t("div",{staticClass:"flex-1 flex overflow-hidden"},[t("aside",{staticClass:"bg-sidebar border-r border-border flex flex-col shrink-0",style:{width:e.sidebarWidth+"px"}},[e._m(0),t("div",{staticClass:"flex items-center gap-1 px-2 py-2 border-b border-border"},[t("button",{staticClass:"p-1 text-textMuted hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",attrs:{disabled:!e.browseResult.parent_path&&e.browseResult.parent_path!=="",title:"上级目录"},on:{click:e.goUp}},[t("i",{staticClass:"fa-solid fa-arrow-up"})]),t("button",{staticClass:"p-1 text-textMuted hover:text-white",attrs:{title:"刷新"},on:{click:e.refresh}},[t("i",{staticClass:"fa-solid fa-refresh"})]),t("button",{staticClass:"p-1 text-textMuted hover:text-white",attrs:{title:"我的电脑"},on:{click:e.goHome}},[t("i",{staticClass:"fa-solid fa-home"})])]),t("div",{staticClass:"flex-1 overflow-y-auto py-1 sidebar-scroll"},[e.loading?t("div",{staticClass:"flex items-center justify-center py-8 text-textMuted"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.fileTreeData.length===0?t("div",{staticClass:"flex items-center justify-center py-8 text-textMuted text-sm"},[e._v(" 此目录为空 ")]):e._l(e.fileTreeData,function(n){return t("file-tree-node",{key:n.path,attrs:{node:n,level:0,"selected-path":e.selectedPath},on:{select:e.handleSelect,"open-file":e.openFile,"load-children":e.handleLoadChildren,contextmenu:e.showContextMenu}})})],2),t("div",{directives:[{name:"show",rawName:"v-show",value:e.contextMenu.visible,expression:"contextMenu.visible"}],staticClass:"fixed bg-sidebar border border-border rounded shadow-lg py-1 z-50 min-w-[160px]",style:{left:e.contextMenu.x+"px",top:e.contextMenu.y+"px"}},[(i=e.contextMenu.target)!=null&&i.is_directory?[t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.copyPath}},[t("i",{staticClass:"fa-solid fa-copy text-xs"}),e._v(" 复制路径 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.createNewFile}},[t("i",{staticClass:"fa-solid fa-file-lines text-xs"}),e._v(" 新建文件 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.createNewFolder}},[t("i",{staticClass:"fa-solid fa-folder-plus text-xs"}),e._v(" 新建文件夹 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.triggerFileUpload}},[t("i",{staticClass:"fa-solid fa-upload text-xs"}),e._v(" 上传文件 ")]),t("div",{staticClass:"border-t border-border my-1"}),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.renameItem}},[t("i",{staticClass:"fa-solid fa-pen text-xs"}),e._v(" 重命名 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-red-400 hover:bg-active flex items-center gap-2",on:{click:e.deleteItem}},[t("i",{staticClass:"fa-solid fa-trash text-xs"}),e._v(" 删除 ")])]:[t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.copyPath}},[t("i",{staticClass:"fa-solid fa-copy text-xs"}),e._v(" 复制路径 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.downloadFile}},[t("i",{staticClass:"fa-solid fa-download text-xs"}),e._v(" 下载 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.renameItem}},[t("i",{staticClass:"fa-solid fa-pen text-xs"}),e._v(" 重命名 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-red-400 hover:bg-active flex items-center gap-2",on:{click:e.deleteItem}},[t("i",{staticClass:"fa-solid fa-trash text-xs"}),e._v(" 删除 ")])]],2),t("div",{directives:[{name:"show",rawName:"v-show",value:e.inputDialog.visible,expression:"inputDialog.visible"}],staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",on:{click:function(n){return n.target!==n.currentTarget?null:e.cancelInput.apply(null,arguments)}}},[t("div",{staticClass:"bg-sidebar border border-border rounded p-4 w-80"},[t("p",{staticClass:"text-white text-sm mb-3"},[e._v(e._s(e.inputDialog.title))]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.inputDialog.value,expression:"inputDialog.value"}],ref:"renameInput",staticClass:"w-full px-3 py-2 bg-[#1e1e1e] border border-border rounded text-white text-sm focus:outline-none focus:border-accent",attrs:{placeholder:e.inputDialog.placeholder},domProps:{value:e.inputDialog.value},on:{keyup:[function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.confirmInput.apply(null,arguments)},function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"escape",void 0,n.key,void 0)?null:e.cancelInput.apply(null,arguments)}],input:function(n){n.target.composing||e.$set(e.inputDialog,"value",n.target.value)}}}),t("div",{staticClass:"flex justify-end gap-2 mt-4"},[t("button",{staticClass:"px-3 py-1 text-xs text-textMuted hover:text-white",on:{click:e.cancelInput}},[e._v("取消")]),t("button",{staticClass:"px-3 py-1 text-xs bg-accent text-white rounded hover:bg-blue-600",on:{click:e.confirmInput}},[e._v("确定")])])])]),t("input",{ref:"fileInput",staticClass:"hidden",attrs:{type:"file"},on:{change:e.handleFileSelect}}),e.uploadProgress.visible?t("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50"},[t("div",{staticClass:"bg-sidebar border border-border rounded p-4 w-80"},[t("p",{staticClass:"text-white text-sm mb-3"},[e._v("正在上传 "+e._s(e.uploadProgress.filename))]),t("div",{staticClass:"w-full bg-[#1e1e1e] rounded-full h-2"},[t("div",{staticClass:"bg-accent h-2 rounded-full transition-all",style:{width:e.uploadProgress.percent+"%"}})]),t("p",{staticClass:"text-textMuted text-xs mt-2 text-center"},[e._v(e._s(e.uploadProgress.percent)+"%")]),t("button",{staticClass:"w-full mt-4 py-2 text-xs text-textMuted hover:text-white border border-border rounded",on:{click:e.cancelUpload}},[e._v("取消")])])]):e._e(),e.downloadProgress.visible?t("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50"},[t("div",{staticClass:"bg-sidebar border border-border rounded p-4 w-80"},[t("p",{staticClass:"text-white text-sm mb-3"},[e._v("正在下载 "+e._s(e.downloadProgress.filename))]),t("div",{staticClass:"w-full bg-[#1e1e1e] rounded-full h-2"},[t("div",{staticClass:"bg-accent h-2 rounded-full transition-all",style:{width:e.downloadProgress.percent+"%"}})]),t("p",{staticClass:"text-textMuted text-xs mt-2 text-center"},[e._v(e._s(e.downloadProgress.percent)+"%")]),t("button",{staticClass:"w-full mt-4 py-2 text-xs text-textMuted hover:text-white border border-border rounded",on:{click:e.cancelDownload}},[e._v("取消")])])]):e._e()]),t("div",{staticClass:"w-1 bg-border hover:bg-accent cursor-col-resize transition-colors",on:{mousedown:e.startResize}}),t("main",{staticClass:"flex-1 flex flex-col min-w-0 bg-[#1e1e1e]"},[t("div",{staticClass:"flex border-b border-border bg-sidebar overflow-x-auto"},e._l(e.openFiles,function(n){var r;return t("div",{key:n.path,staticClass:"flex items-center gap-2 px-3 py-2 cursor-pointer border-r border-border",class:((r=e.activeFile)==null?void 0:r.path)===n.path?"bg-[#1e1e1e] text-white border-t-2 border-t-accent":"text-textMuted hover:bg-[#2a2a2a]",on:{click:function(o){e.activeFile=n}}},[t("i",{staticClass:"text-xs",class:e.getFileIcon(n.name)}),t("span",{staticClass:"text-xs"},[e._v(e._s(n.name))]),t("button",{staticClass:"ml-2 hover:text-white text-textMuted",on:{click:function(o){return o.stopPropagation(),e.closeFile(n)}}},[t("i",{staticClass:"fa-solid fa-times text-[10px]"})])])}),0),t("div",{staticClass:"flex-1 overflow-hidden"},[e.activeFile?e.fileLoading?t("div",{staticClass:"flex items-center justify-center h-full text-textMuted"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.isBinaryFile?t("div",{staticClass:"flex items-center justify-center h-full text-textMuted"},[e._m(1)]):e._e():t("div",{staticClass:"text-textMuted text-center mt-20"},[t("i",{staticClass:"fa-solid fa-file-code text-6xl mb-4 opacity-20"}),t("p",[e._v("双击左侧文件打开编辑器")])]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.activeFile&&!e.isBinaryFile,expression:"activeFile && !isBinaryFile"}],ref:"editorContainer",staticClass:"monaco-editor-container"})]),e.activeFile&&!e.isBinaryFile?t("div",{staticClass:"h-8 bg-sidebar border-t border-border flex items-center justify-between px-3"},[t("div",{staticClass:"flex items-center gap-4 text-xs text-textMuted"},[t("span",[e._v(e._s(e.activeFile.path))]),e.hasChanges?t("span",{staticClass:"text-yellow-500"},[e._v("已修改")]):e._e()]),t("div",{staticClass:"flex items-center gap-2"},[t("button",{staticClass:"px-3 py-1 text-xs bg-primary hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed text-white rounded",attrs:{disabled:!e.hasChanges||e.saving},on:{click:e.saveFile}},[e.saving?t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-1"}):t("i",{staticClass:"fa-solid fa-save mr-1"}),e._v(" 保存 ")])])]):e._e()]),t("CopyPathDialog",{ref:"copyPathDialog"})],1)},yft=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"flex border-b border-border text-xs uppercase font-bold text-textMuted"},[e("div",{staticClass:"px-4 py-2 border-b-2 border-accent text-white flex items-center gap-2"},[e("i",{staticClass:"fa-solid fa-folder-open"}),s._v(" Explorer ")])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fa-solid fa-file text-4xl mb-4 opacity-30"}),e("p",[s._v("二进制文件无法预览")])])}],wft=en(bft,Cft,yft,!1,null,"243d3df6");const Sft=wft.exports,xft={name:"SkillRepositories",props:{repositories:{type:Array,default:()=>[]},repoSkills:{type:Object,default:()=>({})},loadingSkills:{type:Object,default:()=>({})},downloadingAll:{type:Object,default:()=>({})}},data(){return{expandedRepos:new Set}},methods:{toggleExpand(s){this.expandedRepos.has(s)?this.expandedRepos.delete(s):(this.expandedRepos.add(s),this.repoSkills[s]||this.$emit("load-skills",s)),this.expandedRepos=new Set(this.expandedRepos)}}};var kft=function(){var e=this,t=e._self._c;return t("div",{staticClass:"skill-repositories"},[t("div",{staticClass:"flex justify-between items-center mb-4"},[t("h3",{staticClass:"text-lg text-white font-light"},[e._v("Remote Repositories")]),t("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(i){return e.$emit("add")}}},[t("i",{staticClass:"fa-solid fa-plus mr-1"}),e._v(" Add Repository ")])],1),e.repositories.length===0?t("div",{staticClass:"text-center text-textMuted py-8"},[t("i",{staticClass:"fa-solid fa-server text-4xl mb-4 opacity-30"}),t("p",[e._v("No repositories configured")])]):t("div",{staticClass:"space-y-2"},e._l(e.repositories,function(i){return t("div",{key:i.id,staticClass:"bg-sidebar border border-border rounded overflow-hidden"},[t("div",{staticClass:"repo-header p-3 flex items-center gap-3 cursor-pointer hover:bg-white/5",on:{click:function(n){return e.toggleExpand(i.id)}}},[t("span",{staticClass:"expand-icon text-textMuted text-xs transition-transform",class:{"rotate-90":e.expandedRepos.has(i.id)}},[t("i",{staticClass:"fa-solid fa-chevron-right"})]),t("div",{staticClass:"flex-1 min-w-0"},[t("div",{staticClass:"flex items-center gap-2"},[t("span",{staticClass:"text-white font-medium text-sm truncate"},[e._v(e._s(i.name))]),i.isSynced?t("el-tag",{attrs:{type:"success",size:"mini"}},[e._v("Synced")]):t("el-tag",{attrs:{type:"info",size:"mini"}},[e._v("Not Synced")])],1),t("div",{staticClass:"text-textMuted text-xs truncate mt-1"},[e._v(e._s(i.url))])]),t("div",{staticClass:"flex items-center gap-2"},[t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(n){return n.stopPropagation(),e.$emit("sync",i)}}},[e._v("Sync")]),t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(n){return n.stopPropagation(),e.$emit("edit",i)}}},[e._v("Edit")]),t("el-button",{staticClass:"delete-btn",attrs:{type:"text",size:"small"},on:{click:function(n){return n.stopPropagation(),e.$emit("delete",i.id)}}},[e._v("Delete")])],1)]),t("div",{staticClass:"skills-panel border-t border-border",class:{hidden:!e.expandedRepos.has(i.id)}},[t("div",{staticClass:"p-3 bg-black/20"},[i.isSynced?t("div",[t("div",{staticClass:"flex justify-between items-center mb-2"},[t("div",{staticClass:"text-textMuted text-xs"},[e._v(" Last sync: "+e._s(i.last_sync_at?new Date(i.last_sync_at).toLocaleString():"Never")+" ")]),e.repoSkills[i.id]&&e.repoSkills[i.id].length>0?t("el-button",{attrs:{type:"text",size:"small",loading:e.downloadingAll[i.id]},on:{click:function(n){return n.stopPropagation(),e.$emit("download-all",i.id)}}},[e._v(" Install All ")]):e._e()],1),t("div",{staticClass:"space-y-1"},[e.loadingSkills[i.id]?t("div",{staticClass:"text-textMuted text-xs"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-1"}),e._v(" Loading skills... ")]):!e.repoSkills[i.id]||e.repoSkills[i.id].length===0?t("div",{staticClass:"text-textMuted text-xs"},[e._v(" No skills found in this repository. ")]):e._l(e.repoSkills[i.id],function(n){return t("div",{key:n.name,staticClass:"flex items-center justify-between py-1"},[t("div",{staticClass:"flex items-center gap-2"},[t("span",{staticClass:"text-sm text-textMain"},[e._v(e._s(n.name))]),n.license?t("el-tag",{attrs:{type:"warning",size:"mini"}},[e._v(e._s(n.license))]):e._e()],1),t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(r){return e.$emit("download-skill",i.id,n.name)}}},[e._v("Install")])],1)})],2)]):t("div",{staticClass:"text-textMuted text-xs"},[t("i",{staticClass:"fa-solid fa-info-circle mr-1"}),e._v(" Click Sync to clone the repository ")])])])])}),0)])},Lft=[],Dft=en(xft,kft,Lft,!1,null,"a101e9d2");const Ift=Dft.exports,Eft={name:"RemoteSkills",components:{SkillRepositories:Ift},props:{repositories:{type:Array,default:()=>[]},repoSkills:{type:Object,default:()=>({})},loadingSkills:{type:Object,default:()=>({})},downloadingAll:{type:Object,default:()=>({})}}};var Tft=function(){var e=this,t=e._self._c;return t("div",[t("SkillRepositories",{attrs:{repositories:e.repositories,"repo-skills":e.repoSkills,"loading-skills":e.loadingSkills,"downloading-all":e.downloadingAll},on:{add:function(i){return e.$emit("add")},edit:function(i){return e.$emit("edit",i)},delete:function(i){return e.$emit("delete",i)},sync:function(i){return e.$emit("sync",i)},"load-skills":function(i){return e.$emit("load-skills",i)},"download-skill":(...i)=>e.$emit("download-skill",...i),"download-all":function(i){return e.$emit("download-all",i)}}})],1)},Nft=[],Mft=en(Eft,Tft,Nft,!1,null,null);const Rft=Mft.exports,Pft={name:"LocalSkillsList",props:{skills:{type:Array,default:()=>[]}}};var Oft=function(){var e=this,t=e._self._c;return t("div",{staticClass:"local-skills-list"},[e._m(0),e.skills.length===0?t("div",{staticClass:"text-center text-textMuted py-8"},[t("i",{staticClass:"fa-solid fa-folder-open text-4xl mb-4 opacity-30"}),t("p",[e._v("No local skills")]),t("p",{staticClass:"text-xs mt-2"},[e._v("Download from repositories to install skills")])]):t("div",{staticClass:"space-y-2"},e._l(e.skills,function(i){return t("div",{key:i.name,staticClass:"bg-sidebar border border-border p-3 rounded flex justify-between items-start hover:border-accent group"},[t("div",{staticClass:"flex gap-3 flex-1 min-w-0"},[e._m(1,!0),t("div",{staticClass:"min-w-0 flex-1"},[t("div",{staticClass:"flex items-center gap-2"},[t("h4",{staticClass:"text-white font-bold text-sm"},[e._v(e._s(i.name))])]),t("p",{staticClass:"text-textMuted text-xs mt-1 line-clamp-2"},[e._v(e._s(i.description||"No description"))])])]),t("div",{staticClass:"flex items-center gap-2 ml-4"},[t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(n){return e.$emit("view",i)}}},[t("i",{staticClass:"fa-solid fa-eye"})]),t("el-button",{staticClass:"delete-btn",attrs:{type:"text",size:"small"},on:{click:function(n){return e.$emit("delete",i.name)}}},[t("i",{staticClass:"fa-solid fa-trash"})])],1)])}),0)])},Aft=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"mb-4"},[e("p",{staticClass:"text-textMuted text-xs mb-4"},[s._v(" Local skills are stored in the "),e("code",{staticClass:"bg-black/30 px-1 rounded"},[s._v(".txcode/skills/")]),s._v(" directory ")])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"w-10 h-10 rounded flex items-center justify-center text-xl bg-green-900/30 text-green-400 shrink-0"},[e("i",{staticClass:"fa-solid fa-bolt"})])}],Fft=en(Pft,Oft,Aft,!1,null,"f6cd3ef5");const Bft=Fft.exports,Wft={name:"SkillRepositoryDialog",props:{visible:{type:Boolean,default:!1},repository:{type:Object,default:null}},data(){return{form:{name:"",url:""},rules:{name:[{required:!0,message:"Please enter repository name",trigger:"blur"}],url:[{required:!0,message:"Please enter repository URL",trigger:"blur"},{type:"url",message:"Please enter a valid URL",trigger:"blur"}]}}},computed:{dialogVisible:{get(){return this.visible},set(s){this.$emit("update:visible",s)}},isEdit(){return!!this.repository}},watch:{repository:{immediate:!0,handler(s){s?(this.form.name=s.name,this.form.url=s.url):(this.form.name="",this.form.url="")}}},methods:{handleClose(){var s;(s=this.$refs.form)==null||s.resetFields(),this.$emit("close")},handleSubmit(){this.$refs.form.validate(s=>{var e;s&&(this.$emit("submit",{id:(e=this.repository)==null?void 0:e.id,name:this.form.name,url:this.form.url,type:"custom"}),this.handleClose())})}}};var Vft=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.isEdit?"Edit Repository":"Add Repository",visible:e.dialogVisible,width:"500px"},on:{"update:visible":function(i){e.dialogVisible=i},close:e.handleClose}},[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"100px"}},[t("el-form-item",{attrs:{label:"Name",prop:"name"}},[t("el-input",{attrs:{placeholder:"Repository name"},model:{value:e.form.name,callback:function(i){e.$set(e.form,"name",i)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"URL",prop:"url"}},[t("el-input",{attrs:{placeholder:"Git repository URL"},scopedSlots:e._u([{key:"append",fn:function(){return[t("el-tooltip",{attrs:{content:"Can be a Gitee/GitHub repository URL"}},[t("i",{staticClass:"fa-solid fa-info-circle text-textMuted"})])]},proxy:!0}]),model:{value:e.form.url,callback:function(i){e.$set(e.form,"url",i)},expression:"form.url"}})],1)],1),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.handleClose}},[e._v("Cancel")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleSubmit}},[e._v("Confirm")])],1)],1)},Hft=[],$ft=en(Wft,Vft,Hft,!1,null,null);const zft=$ft.exports,jft={name:"SkillViewer",props:{visible:{type:Boolean,default:!1},skill:{type:Object,default:null},content:{type:String,default:""}},computed:{dialogVisible:{get(){return this.visible},set(s){this.$emit("update:visible",s)}}}};var Uft=function(){var e=this,t=e._self._c;return t("el-dialog",{staticClass:"skill-viewer-dialog",attrs:{title:"Skill Content",visible:e.dialogVisible,width:"800px"},on:{"update:visible":function(i){e.dialogVisible=i}}},[e.skill?t("div",{staticClass:"max-h-[60vh] overflow-y-auto"},[t("div",{staticClass:"mb-4"},[t("h3",{staticClass:"text-lg font-bold text-white"},[e._v(e._s(e.skill.name))]),t("p",{staticClass:"text-textMuted text-sm mt-1"},[e._v(e._s(e.skill.description))])]),t("pre",{staticClass:"bg-sidebar p-4 rounded text-sm text-textMain overflow-x-auto whitespace-pre-wrap"},[e._v(e._s(e.content))])]):e._e()])},qft=[],Kft=en(jft,Uft,qft,!1,null,"ca1085ae");const Gft=Kft.exports,Yft={name:"SpecRepositories",props:{repositories:{type:Array,default:()=>[]},repoSpecs:{type:Object,default:()=>({})},loadingSpecs:{type:Object,default:()=>({})},downloadingAll:{type:Object,default:()=>({})}},data(){return{expandedRepos:new Set}},methods:{toggleExpand(s){this.expandedRepos.has(s)?this.expandedRepos.delete(s):(this.expandedRepos.add(s),this.repoSpecs[s]||this.$emit("load-specs",s)),this.expandedRepos=new Set(this.expandedRepos)}}};var Zft=function(){var e=this,t=e._self._c;return t("div",{staticClass:"spec-repositories"},[t("div",{staticClass:"flex justify-between items-center mb-4"},[t("h3",{staticClass:"text-lg text-white font-light"},[e._v("Remote Repositories")]),t("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(i){return e.$emit("add")}}},[t("i",{staticClass:"fa-solid fa-plus mr-1"}),e._v(" Add Repository ")])],1),e.repositories.length===0?t("div",{staticClass:"text-center text-textMuted py-8"},[t("i",{staticClass:"fa-solid fa-server text-4xl mb-4 opacity-30"}),t("p",[e._v("No repositories configured")])]):t("div",{staticClass:"space-y-2"},e._l(e.repositories,function(i){return t("div",{key:i.id,staticClass:"bg-sidebar border border-border rounded overflow-hidden"},[t("div",{staticClass:"repo-header p-3 flex items-center gap-3 cursor-pointer hover:bg-white/5",on:{click:function(n){return e.toggleExpand(i.id)}}},[t("span",{staticClass:"expand-icon text-textMuted text-xs transition-transform",class:{"rotate-90":e.expandedRepos.has(i.id)}},[t("i",{staticClass:"fa-solid fa-chevron-right"})]),t("div",{staticClass:"flex-1 min-w-0"},[t("div",{staticClass:"flex items-center gap-2"},[t("span",{staticClass:"text-white font-medium text-sm truncate"},[e._v(e._s(i.name))]),i.isSynced?t("el-tag",{attrs:{type:"success",size:"mini"}},[e._v("Synced")]):t("el-tag",{attrs:{type:"info",size:"mini"}},[e._v("Not Synced")])],1),t("div",{staticClass:"text-textMuted text-xs truncate mt-1"},[e._v(e._s(i.url))])]),t("div",{staticClass:"flex items-center gap-2"},[t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(n){return n.stopPropagation(),e.$emit("sync",i)}}},[e._v("Sync")]),t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(n){return n.stopPropagation(),e.$emit("edit",i)}}},[e._v("Edit")]),t("el-button",{staticClass:"delete-btn",attrs:{type:"text",size:"small"},on:{click:function(n){return n.stopPropagation(),e.$emit("delete",i.id)}}},[e._v("Delete")])],1)]),t("div",{staticClass:"specs-panel border-t border-border",class:{hidden:!e.expandedRepos.has(i.id)}},[t("div",{staticClass:"p-3 bg-black/20"},[i.isSynced?t("div",[t("div",{staticClass:"flex justify-between items-center mb-2"},[t("div",{staticClass:"text-textMuted text-xs"},[e._v(" Last sync: "+e._s(i.last_sync_at?new Date(i.last_sync_at).toLocaleString():"Never")+" ")]),e.repoSpecs[i.id]&&e.repoSpecs[i.id].length>0?t("el-button",{attrs:{type:"text",size:"small",loading:e.downloadingAll[i.id]},on:{click:function(n){return n.stopPropagation(),e.$emit("download-all",i.id)}}},[e._v(" Install All ")]):e._e()],1),t("div",{staticClass:"space-y-1"},[e.loadingSpecs[i.id]?t("div",{staticClass:"text-textMuted text-xs"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-1"}),e._v(" Loading specs... ")]):!e.repoSpecs[i.id]||e.repoSpecs[i.id].length===0?t("div",{staticClass:"text-textMuted text-xs"},[e._v(" No specs found in this repository. ")]):e._l(e.repoSpecs[i.id],function(n){return t("div",{key:n.name,staticClass:"flex items-center justify-between py-1"},[t("div",{staticClass:"flex items-center gap-2"},[t("span",{staticClass:"text-sm text-textMain"},[e._v(e._s(n.name))]),n.read_mode==="required"?t("el-tag",{attrs:{type:"warning",size:"mini"}},[e._v("Required")]):t("el-tag",{attrs:{type:"info",size:"mini"}},[e._v("Optional")])],1),t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(r){return e.$emit("download-spec",i.id,n.name)}}},[e._v("Install")])],1)})],2)]):t("div",{staticClass:"text-textMuted text-xs"},[t("i",{staticClass:"fa-solid fa-info-circle mr-1"}),e._v(" Click Sync to clone the repository ")])])])])}),0)])},Xft=[],Qft=en(Yft,Zft,Xft,!1,null,"8f4d8a09");const Jft=Qft.exports,egt={name:"RemoteSpecs",components:{SpecRepositories:Jft},props:{repositories:{type:Array,default:()=>[]},repoSpecs:{type:Object,default:()=>({})},loadingSpecs:{type:Object,default:()=>({})},downloadingAll:{type:Object,default:()=>({})}}};var tgt=function(){var e=this,t=e._self._c;return t("div",[t("SpecRepositories",{attrs:{repositories:e.repositories,"repo-specs":e.repoSpecs,"loading-specs":e.loadingSpecs,"downloading-all":e.downloadingAll},on:{add:function(i){return e.$emit("add")},edit:function(i){return e.$emit("edit",i)},delete:function(i){return e.$emit("delete",i)},sync:function(i){return e.$emit("sync",i)},"load-specs":function(i){return e.$emit("load-specs",i)},"download-spec":(...i)=>e.$emit("download-spec",...i),"download-all":function(i){return e.$emit("download-all",i)}}})],1)},igt=[],ngt=en(egt,tgt,igt,!1,null,null);const sgt=ngt.exports,rgt={name:"LocalSpecsList",props:{specs:{type:Array,default:()=>[]}}};var ogt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"local-specs-list"},[e._m(0),e.specs.length===0?t("div",{staticClass:"text-center text-textMuted py-8"},[t("i",{staticClass:"fa-solid fa-folder-open text-4xl mb-4 opacity-30"}),t("p",[e._v("No local specs")]),t("p",{staticClass:"text-xs mt-2"},[e._v("Download from repositories or upload new specs")])]):t("div",{staticClass:"space-y-2"},e._l(e.specs,function(i){return t("div",{key:i.name,staticClass:"bg-sidebar border border-border p-3 rounded flex justify-between items-start hover:border-accent group"},[t("div",{staticClass:"flex gap-3 flex-1 min-w-0"},[e._m(1,!0),t("div",{staticClass:"min-w-0 flex-1"},[t("div",{staticClass:"flex items-center gap-2"},[t("h4",{staticClass:"text-white font-bold text-sm"},[e._v(e._s(i.name))]),i.read_mode==="required"?t("el-tag",{attrs:{type:"warning",size:"mini"}},[e._v("Required")]):t("el-tag",{attrs:{type:"info",size:"mini"}},[e._v("Optional")])],1),t("p",{staticClass:"text-textMuted text-xs mt-1 line-clamp-2"},[e._v(e._s(i.description||"No description"))])])]),t("div",{staticClass:"flex items-center gap-2 ml-4"},[t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(n){return e.$emit("view",i)}}},[t("i",{staticClass:"fa-solid fa-eye"})]),t("el-button",{staticClass:"delete-btn",attrs:{type:"text",size:"small"},on:{click:function(n){return e.$emit("delete",i.name)}}},[t("i",{staticClass:"fa-solid fa-trash"})])],1)])}),0)])},agt=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"mb-4"},[e("p",{staticClass:"text-textMuted text-xs mb-4"},[s._v(" Local specs are stored in the "),e("code",{staticClass:"bg-black/30 px-1 rounded"},[s._v("~/.txcode/specs/")]),s._v(" directory ")])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"w-10 h-10 rounded flex items-center justify-center text-xl bg-blue-900/30 text-blue-400 shrink-0"},[e("i",{staticClass:"fa-solid fa-file-alt"})])}],lgt=en(rgt,ogt,agt,!1,null,"256a305a");const cgt=lgt.exports,dgt={name:"SpecRepositoryDialog",props:{visible:{type:Boolean,default:!1},repository:{type:Object,default:null}},data(){return{form:{name:"",url:""},rules:{name:[{required:!0,message:"Please enter repository name",trigger:"blur"}],url:[{required:!0,message:"Please enter repository URL",trigger:"blur"},{type:"url",message:"Please enter a valid URL",trigger:"blur"}]}}},computed:{dialogVisible:{get(){return this.visible},set(s){this.$emit("update:visible",s)}},isEdit(){return!!this.repository}},watch:{repository:{immediate:!0,handler(s){s?(this.form.name=s.name,this.form.url=s.url):(this.form.name="",this.form.url="")}}},methods:{handleClose(){var s;(s=this.$refs.form)==null||s.resetFields(),this.$emit("close")},handleSubmit(){this.$refs.form.validate(s=>{var e;s&&(this.$emit("submit",{id:(e=this.repository)==null?void 0:e.id,name:this.form.name,url:this.form.url,type:"custom"}),this.handleClose())})}}};var ugt=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.isEdit?"Edit Repository":"Add Repository",visible:e.dialogVisible,width:"500px"},on:{"update:visible":function(i){e.dialogVisible=i},close:e.handleClose}},[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"100px"}},[t("el-form-item",{attrs:{label:"Name",prop:"name"}},[t("el-input",{attrs:{placeholder:"Repository name"},model:{value:e.form.name,callback:function(i){e.$set(e.form,"name",i)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"URL",prop:"url"}},[t("el-input",{attrs:{placeholder:"Git repository URL"},scopedSlots:e._u([{key:"append",fn:function(){return[t("el-tooltip",{attrs:{content:"Can be a Gitee/GitHub repository URL"}},[t("i",{staticClass:"fa-solid fa-info-circle text-textMuted"})])]},proxy:!0}]),model:{value:e.form.url,callback:function(i){e.$set(e.form,"url",i)},expression:"form.url"}})],1)],1),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.handleClose}},[e._v("Cancel")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleSubmit}},[e._v("Confirm")])],1)],1)},hgt=[],fgt=en(dgt,ugt,hgt,!1,null,null);const ggt=fgt.exports,pgt={name:"SpecViewer",props:{visible:{type:Boolean,default:!1},spec:{type:Object,default:null},content:{type:String,default:""}},computed:{dialogVisible:{get(){return this.visible},set(s){this.$emit("update:visible",s)}}}};var mgt=function(){var e=this,t=e._self._c;return t("el-dialog",{staticClass:"spec-viewer-dialog",attrs:{title:"Spec Content",visible:e.dialogVisible,width:"800px"},on:{"update:visible":function(i){e.dialogVisible=i}}},[e.spec?t("div",{staticClass:"max-h-[60vh] overflow-y-auto"},[t("div",{staticClass:"mb-4"},[t("h3",{staticClass:"text-lg font-bold text-white"},[e._v(e._s(e.spec.name))]),t("p",{staticClass:"text-textMuted text-sm mt-1"},[e._v(e._s(e.spec.description))])]),t("pre",{staticClass:"bg-sidebar p-4 rounded text-sm text-textMain overflow-x-auto whitespace-pre-wrap"},[e._v(e._s(e.content))])]):e._e()])},_gt=[],vgt=en(pgt,mgt,_gt,!1,null,"f9b3ba71");const bgt=vgt.exports,Cgt={name:"MemoryDisplay",props:{items:{type:Array,default:()=>[]}}};var ygt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"memory-display"},[e.items.length===0?t("div",{staticClass:"text-textMuted text-center py-8"},[e._v(" No memories yet. Click the edit button to add some. ")]):t("div",{staticClass:"space-y-4"},e._l(e.items,function(i,n){return t("div",{key:n,staticClass:"bg-sidebar rounded p-4 border border-border"},[t("div",{staticClass:"text-white whitespace-pre-wrap"},[e._v(e._s(i.content))]),i.description?t("div",{staticClass:"text-textMuted text-sm mt-2 whitespace-pre-wrap"},[e._v(e._s(i.description))]):e._e()])}),0)])},wgt=[],Sgt=en(Cgt,ygt,wgt,!1,null,null);const xgt=Sgt.exports,kgt={name:"MemoryEditDialog",props:{visible:{type:Boolean,default:!1},content:{type:String,default:""}},data(){return{editContent:""}},computed:{dialogVisible:{get(){return this.visible},set(s){this.$emit("update:visible",s)}}},watch:{content(s){this.editContent=s}},methods:{handleClose(){this.$emit("update:visible",!1),this.$emit("close")},handleSave(){this.$emit("update:visible",!1),this.$emit("save",this.editContent)}}};var Lgt=function(){var e=this,t=e._self._c;return t("el-dialog",{staticClass:"memory-edit-dialog",attrs:{title:"Edit Memory",visible:e.dialogVisible,width:"800px"},on:{"update:visible":function(i){e.dialogVisible=i},close:e.handleClose}},[t("div",{staticClass:"mb-2 text-textMuted text-sm"},[e._v(' Format: memory content followed by optional description after "---", separated by § ')]),t("el-input",{staticClass:"w-full",attrs:{type:"textarea",rows:15},model:{value:e.editContent,callback:function(i){e.editContent=i},expression:"editContent"}}),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.handleClose}},[e._v("Cancel")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleSave}},[e._v("Save")])],1)],1)},Dgt=[],Igt=en(kgt,Lgt,Dgt,!1,null,"144910b3");const Egt=Igt.exports,Tgt={name:"Skills",components:{RemoteSkills:Rft,LocalSkillsList:Bft,SkillRepositoryDialog:zft,SkillViewer:Gft,RemoteSpecs:sgt,LocalSpecsList:cgt,SpecRepositoryDialog:ggt,SpecViewer:bgt,MemoryDisplay:xgt,MemoryEditDialog:Egt},data(){return{subTab:"remoteSkills",filterText:"",skillRepositories:[],repoSkills:{},loadingSkills:{},downloadingAll:{},localSkills:[],repositories:[],repoSpecs:{},loadingSpecs:{},downloadingAllSpecs:{},localSpecs:[],showAddDialog:!1,editingRepo:null,showAddSkillDialog:!1,editingSkillRepo:null,showSpecViewer:!1,currentSpec:null,currentSpecContent:"",showSkillViewer:!1,currentSkill:null,currentSkillContent:"",projectPath:"",memoryItems:[],memoryRawContent:"",showMemoryEdit:!1}},computed:{filteredSkills(){if(!this.filterText)return this.localSkills;const s=this.filterText.toLowerCase();return this.localSkills.filter(e=>{var t;return e.name.toLowerCase().includes(s)||((t=e.description)==null?void 0:t.toLowerCase().includes(s))})}},watch:{subTab(s){s==="memory"&&this.projectPath&&this.loadMemory()}},async created(){await this.loadProjectPath(),await this.loadSkillRepositories(),await this.loadLocalSkills(),await this.loadRepositories(),await this.loadLocalSpecs(),this.subTab==="memory"&&await this.loadMemory()},methods:{async loadProjectPath(){try{const s=await Yt.getProjectPath();s.success&&s.data&&(this.projectPath=s.data.path||"")}catch(s){console.error("Failed to load project path:",s)}},async loadSkillRepositories(){try{const s=await Yt.getSkillRepositories();this.skillRepositories=s.data||[]}catch(s){console.error("Failed to load skill repositories:",s),this.skillRepositories=[]}},async loadRepoSKills(s){this.$set(this.loadingSkills,s,!0);try{const e=await Yt.getRemoteSkills(s);this.$set(this.repoSkills,s,e.data||[])}catch(e){console.error("Failed to load repo skills:",e),this.$set(this.repoSkills,s,[])}finally{this.$set(this.loadingSkills,s,!1)}},async loadLocalSkills(){try{const s=await Yt.getLocalSkills(this.projectPath);this.localSkills=s.data||[]}catch(s){console.error("Failed to load local skills:",s),this.localSkills=[]}},handleEditSkillRepo(s){this.editingSkillRepo=s,this.showAddSkillDialog=!0},async handleSubmitSkillRepo(s){try{s.id?await Yt.updateSkillRepository(s.id,s):await Yt.createSkillRepository(s),await this.loadSkillRepositories(),this.editingSkillRepo=null}catch(e){console.error("Failed to submit skill repository:",e),this.$message.error("Failed to submit repository")}},async handleDeleteSkillRepo(s){try{await this.$confirm("Are you sure you want to delete this repository?","Confirm",{type:"warning"}),await Yt.deleteSkillRepository(s),await this.loadSkillRepositories(),this.$message.success("Repository deleted")}catch(e){e!=="cancel"&&console.error("Failed to delete repository:",e)}},async handleSyncSkillRepo(s){var e,t;try{const i=((t=(e=this.$message).loading)==null?void 0:t.call(e,"Syncing repository..."))||(()=>{}),n=await Yt.syncSkillRepository(s.id);i(),n.success?(this.$message.success(n.message||"Sync completed"),await this.loadSkillRepositories(),await this.loadRepoSKills(s.id)):this.$message.error(n.message||"Sync failed")}catch(i){console.error("Failed to sync repository:",i),this.$message.error("Sync failed")}},async handleDownloadSkill(s,e){var t;try{const i=await Yt.downloadSkill(s,e,this.projectPath);this.$message.success(`Downloaded ${e} to ${((t=i.data)==null?void 0:t.projectPath)||this.projectPath}`),await this.loadLocalSkills()}catch(i){console.error("Failed to download skill:",i),this.$message.error("Download failed: "+(i.message||"Unknown error"))}},async handleDownloadAllSkills(s){var e,t,i;try{this.$set(this.downloadingAll,s,!0);const n=await Yt.downloadAllSkills(s,this.projectPath);this.$message.success(`Downloaded ${((t=(e=n.data)==null?void 0:e.downloaded)==null?void 0:t.length)||0} skills to ${((i=n.data)==null?void 0:i.projectPath)||this.projectPath}`),await this.loadLocalSkills()}catch(n){console.error("Failed to download all skills:",n),this.$message.error("Download failed: "+(n.message||"Unknown error"))}finally{this.$set(this.downloadingAll,s,!1)}},async handleViewSkill(s){try{const e=await Yt.getSkillContent(s.name);this.currentSkill=s,this.currentSkillContent=e.data,this.showSkillViewer=!0}catch(e){console.error("Failed to load skill content:",e),this.$message.error("Failed to load skill content")}},async handleDeleteLocalSkill(s){try{await this.$confirm(`Are you sure you want to delete "${s}"?`,"Confirm",{type:"warning"}),await Yt.deleteLocalSkill(s),await this.loadLocalSkills(),this.$message.success("Skill deleted")}catch(e){e!=="cancel"&&console.error("Failed to delete skill:",e)}},async loadRepositories(){try{const s=await Yt.getSpecRepositories();this.repositories=s.data||[]}catch(s){console.error("Failed to load repositories:",s),this.repositories=[]}},async loadLocalSpecs(){var s;try{const e=await Yt.getLocalSpecs(this.projectPath);this.localSpecs=((s=e.data)==null?void 0:s.specs)||[]}catch(e){console.error("Failed to load local specs:",e),this.localSpecs=[]}},async loadRepoSpecs(s){this.$set(this.loadingSpecs,s,!0);try{const e=await Yt.getRepoSpecs(s);this.$set(this.repoSpecs,s,e.data||[])}catch(e){console.error("Failed to load repo specs:",e),this.$set(this.repoSpecs,s,[])}finally{this.$set(this.loadingSpecs,s,!1)}},handleEditRepo(s){this.editingRepo=s,this.showAddDialog=!0},async handleSubmitRepo(s){try{s.id?await Yt.updateSpecRepository(s.id,s):await Yt.createSpecRepository(s),await this.loadRepositories(),this.editingRepo=null}catch(e){console.error("Failed to submit repository:",e),this.$message.error("Failed to submit repository")}},async handleDeleteRepo(s){try{await this.$confirm("Are you sure you want to delete this repository?","Confirm",{type:"warning"}),await Yt.deleteSpecRepository(s),await this.loadRepositories(),this.$message.success("Repository deleted")}catch(e){e!=="cancel"&&console.error("Failed to delete repository:",e)}},async handleSyncRepo(s){var e,t;try{const i=((t=(e=this.$message).loading)==null?void 0:t.call(e,"Syncing repository..."))||(()=>{}),n=await Yt.syncSpecRepository(s.id);i(),n.success?(this.$message.success(n.message||"Sync completed"),await this.loadRepositories(),await this.loadRepoSpecs(s.id)):this.$message.error(n.message||"Sync failed")}catch(i){console.error("Failed to sync repository:",i),this.$message.error("Sync failed")}},async handleDownloadSpec(s,e){var t;try{const i=await Yt.downloadSpec(s,e,this.projectPath);this.$message.success(`Downloaded ${e} to ${((t=i.data)==null?void 0:t.projectPath)||this.projectPath}`),await this.loadLocalSpecs()}catch(i){console.error("Failed to download spec:",i),this.$message.error("Download failed: "+(i.message||"Unknown error"))}},async handleViewSpec(s){try{const e=await Yt.getSpecContent(s.name);this.currentSpec=s,this.currentSpecContent=e.data,this.showSpecViewer=!0}catch(e){console.error("Failed to load spec content:",e),this.$message.error("Failed to load spec content")}},async handleDeleteSpec(s){try{await this.$confirm(`Are you sure you want to delete "${s}"?`,"Confirm",{type:"warning"}),await Yt.deleteLocalSpec(s),await this.loadLocalSpecs(),this.$message.success("Spec deleted")}catch(e){e!=="cancel"&&console.error("Failed to delete spec:",e)}},async handleDownloadAll(s){var e,t,i;try{this.$set(this.downloadingAllSpecs,s,!0);const n=await Yt.downloadAllSpecs(s,this.projectPath);this.$message.success(`Downloaded ${((t=(e=n.data)==null?void 0:e.downloaded)==null?void 0:t.length)||0} specs to ${((i=n.data)==null?void 0:i.projectPath)||this.projectPath}`),await this.loadLocalSpecs()}catch(n){console.error("Failed to download all specs:",n),this.$message.error("Download failed: "+(n.message||"Unknown error"))}finally{this.$set(this.downloadingAllSpecs,s,!1)}},async loadMemory(){var s,e;try{const t=await Yt.getMemory(this.projectPath);this.memoryItems=((s=t.data)==null?void 0:s.items)||[],this.memoryRawContent=((e=t.data)==null?void 0:e.rawContent)||""}catch(t){console.error("Failed to load memory:",t),this.memoryItems=[],this.memoryRawContent=""}},openMemoryEdit(){this.showMemoryEdit=!0},async handleSaveMemory(s){try{await Yt.saveMemory(this.projectPath,s),await this.loadMemory(),this.$message.success("Memory saved")}catch(e){console.error("Failed to save memory:",e),this.$message.error("Failed to save memory")}}}};var Ngt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex-1 flex overflow-hidden"},[t("aside",{staticClass:"w-[220px] bg-sidebar border-r border-border flex flex-col shrink-0 py-4"},[t("div",{staticClass:"px-4 mb-4"},[t("h2",{staticClass:"text-white font-bold text-lg mb-1"},[e._v("Skills & Specs")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.filterText,expression:"filterText"}],staticClass:"w-full bg-black/20 border border-border rounded px-2 py-1 text-xs",attrs:{type:"text",placeholder:"Filter..."},domProps:{value:e.filterText},on:{input:function(i){i.target.composing||(e.filterText=i.target.value)}}})]),t("div",{staticClass:"flex-1 overflow-y-auto"},[t("div",{staticClass:"px-4 py-1 text-xs font-bold text-textMuted uppercase mt-2"},[e._v("Skills")]),t("button",{staticClass:"w-full text-left px-4 py-2 flex items-center gap-2",class:e.subTab==="remoteSkills"?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(i){e.subTab="remoteSkills"}}},[t("i",{staticClass:"fa-solid fa-server w-4 text-center"}),e._v(" Remote Skills ")]),t("button",{staticClass:"w-full text-left px-4 py-2 flex items-center gap-2",class:e.subTab==="localSkills"?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(i){e.subTab="localSkills"}}},[t("i",{staticClass:"fa-solid fa-folder w-4 text-center"}),e._v(" Local Skills ")]),t("div",{staticClass:"px-4 py-1 text-xs font-bold text-textMuted uppercase mt-4"},[e._v("Specs")]),t("button",{staticClass:"w-full text-left px-4 py-2 flex items-center gap-2",class:e.subTab==="remote"?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(i){e.subTab="remote"}}},[t("i",{staticClass:"fa-solid fa-server w-4 text-center"}),e._v(" Remote Specs ")]),t("button",{staticClass:"w-full text-left px-4 py-2 flex items-center gap-2",class:e.subTab==="local"?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(i){e.subTab="local"}}},[t("i",{staticClass:"fa-solid fa-folder w-4 text-center"}),e._v(" Local Specs ")]),t("div",{staticClass:"px-4 py-1 text-xs font-bold text-textMuted uppercase mt-4"},[e._v("Memory")]),t("button",{staticClass:"w-full text-left px-4 py-2 flex items-center gap-2",class:e.subTab==="memory"?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(i){e.subTab="memory"}}},[t("i",{staticClass:"fa-solid fa-brain w-4 text-center"}),e._v(" 记忆 ")])])]),t("main",{staticClass:"flex-1 flex flex-col bg-[#1e1e1e] min-w-0"},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.subTab==="remoteSkills",expression:"subTab === 'remoteSkills'"}],staticClass:"flex-1 p-6 overflow-y-auto"},[t("RemoteSkills",{attrs:{repositories:e.skillRepositories,"repo-skills":e.repoSkills,"loading-skills":e.loadingSkills,"downloading-all":e.downloadingAll},on:{add:function(i){e.showAddSkillDialog=!0},edit:e.handleEditSkillRepo,delete:e.handleDeleteSkillRepo,sync:e.handleSyncSkillRepo,"load-skills":e.loadRepoSKills,"download-skill":e.handleDownloadSkill,"download-all":e.handleDownloadAllSkills}})],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.subTab==="localSkills",expression:"subTab === 'localSkills'"}],staticClass:"flex-1 p-6 overflow-y-auto"},[t("LocalSkillsList",{attrs:{skills:e.localSkills},on:{view:e.handleViewSkill,delete:e.handleDeleteLocalSkill}})],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.subTab==="remote",expression:"subTab === 'remote'"}],staticClass:"flex-1 p-6 overflow-y-auto"},[t("RemoteSpecs",{attrs:{repositories:e.repositories,"repo-specs":e.repoSpecs,"loading-specs":e.loadingSpecs,"downloading-all":e.downloadingAllSpecs},on:{add:function(i){e.showAddDialog=!0},edit:e.handleEditRepo,delete:e.handleDeleteRepo,sync:e.handleSyncRepo,"load-specs":e.loadRepoSpecs,"download-spec":e.handleDownloadSpec,"download-all":e.handleDownloadAll}})],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.subTab==="local",expression:"subTab === 'local'"}],staticClass:"flex-1 p-6 overflow-y-auto"},[t("LocalSpecsList",{attrs:{specs:e.localSpecs},on:{view:e.handleViewSpec,delete:e.handleDeleteSpec}})],1),t("div",{directives:[{name:"show",rawName:"v-show",value:e.subTab==="memory",expression:"subTab === 'memory'"}],staticClass:"flex-1 flex flex-col overflow-hidden"},[t("div",{staticClass:"flex items-center justify-between px-6 py-3 border-b border-border"},[t("h2",{staticClass:"text-lg font-bold text-white"},[e._v("记忆")]),t("el-button",{attrs:{size:"small"},on:{click:e.openMemoryEdit}},[t("i",{staticClass:"fa-solid fa-pen"})])],1),t("div",{staticClass:"flex-1 p-6 overflow-y-auto"},[t("MemoryDisplay",{attrs:{items:e.memoryItems}})],1)])]),t("SpecRepositoryDialog",{attrs:{visible:e.showAddDialog,repository:e.editingRepo},on:{"update:visible":function(i){e.showAddDialog=i},submit:e.handleSubmitRepo,close:function(i){e.editingRepo=null}}}),t("SkillRepositoryDialog",{attrs:{visible:e.showAddSkillDialog,repository:e.editingSkillRepo},on:{"update:visible":function(i){e.showAddSkillDialog=i},submit:e.handleSubmitSkillRepo,close:function(i){e.editingSkillRepo=null}}}),t("SpecViewer",{attrs:{visible:e.showSpecViewer,spec:e.currentSpec,content:e.currentSpecContent},on:{"update:visible":function(i){e.showSpecViewer=i}}}),t("SkillViewer",{attrs:{visible:e.showSkillViewer,skill:e.currentSkill,content:e.currentSkillContent},on:{"update:visible":function(i){e.showSkillViewer=i}}}),t("MemoryEditDialog",{attrs:{visible:e.showMemoryEdit,content:e.memoryRawContent},on:{"update:visible":function(i){e.showMemoryEdit=i},save:e.handleSaveMemory}})],1)},Mgt=[],Rgt=en(Tgt,Ngt,Mgt,!1,null,null);const Pgt=Rgt.exports,Ogt={name:"DbView",data(){return{tables:[],selectedTable:null,tableInfo:{},tableData:{columns:[],rows:[]},page:1,pageSize:50,totalPages:1,loading:!1}},async created(){await this.loadTables()},methods:{async loadTables(){this.loading=!0;try{const s=await Yt.getDbTables();this.tables=(s.data||[]).map(e=>e.name)}catch(s){console.error("Load tables failed:",s),this.tables=[]}finally{this.loading=!1}},async selectTable(s){this.selectedTable=s,this.page=1,await this.loadTableInfo(),await this.loadTableData()},async loadTableInfo(){if(this.selectedTable)try{const s=await Yt.getTableInfo(this.selectedTable);this.tableInfo=s.data||{},this.totalPages=Math.max(1,Math.ceil((this.tableInfo.row_count||0)/this.pageSize))}catch(s){console.error("Load table info failed:",s),this.tableInfo={}}},async loadTableData(){if(this.selectedTable)try{const s=await Yt.getTableData(this.selectedTable,this.page,this.pageSize);this.tableData={rows:s.data||[]}}catch(s){console.error("Load table data failed:",s),this.tableData={columns:[],rows:[]}}},async prevPage(){this.page>1&&(this.page--,await this.loadTableData())},async nextPage(){this.page<this.totalPages&&(this.page++,await this.loadTableData())},formatCell(s){return s===null?"<null>":s===void 0?"":typeof s=="boolean"?s?"true":"false":typeof s=="object"?JSON.stringify(s):String(s)}}};var Agt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex-1 flex overflow-hidden"},[t("aside",{staticClass:"w-[260px] bg-sidebar border-r border-border flex flex-col shrink-0"},[e._m(0),t("div",{staticClass:"flex items-center gap-1 px-2 py-2 border-b border-border"},[t("button",{staticClass:"p-1 text-textMuted hover:text-white",attrs:{title:"刷新"},on:{click:e.loadTables}},[t("i",{staticClass:"fa-solid fa-refresh"})])]),t("div",{staticClass:"flex-1 overflow-y-auto py-1"},[e.loading?t("div",{staticClass:"flex items-center justify-center py-8 text-textMuted"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.tables.length===0?t("div",{staticClass:"flex items-center justify-center py-8 text-textMuted text-sm"},[e._v(" 暂无表 ")]):t("div",e._l(e.tables,function(i){return t("div",{key:i,staticClass:"flex items-center gap-2 px-3 py-1.5 cursor-pointer text-sm",class:e.selectedTable===i?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(n){return e.selectTable(i)}}},[t("i",{staticClass:"fa-solid fa-table text-textMuted text-xs"}),t("span",{staticClass:"truncate"},[e._v(e._s(i))])])}),0)])]),t("main",{staticClass:"flex-1 flex flex-col min-w-0 bg-[#1e1e1e]"},[e.selectedTable?t("div",{staticClass:"flex-1 flex flex-col overflow-hidden"},[t("div",{staticClass:"flex items-center justify-between px-4 py-2 border-b border-border bg-sidebar"},[t("div",{staticClass:"flex items-center gap-2"},[t("i",{staticClass:"fa-solid fa-table text-textMuted"}),t("span",{staticClass:"text-sm text-white"},[e._v(e._s(e.selectedTable))]),t("span",{staticClass:"text-xs text-textMuted"},[e._v("("+e._s(e.tableInfo.row_count||0)+" 行)")])]),t("div",{staticClass:"flex items-center gap-2"},[t("button",{staticClass:"px-2 py-1 text-xs text-textMuted hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",attrs:{disabled:e.page<=1},on:{click:e.prevPage}},[t("i",{staticClass:"fa-solid fa-chevron-left"})]),t("span",{staticClass:"text-xs text-textMuted"},[e._v(e._s(e.page)+" / "+e._s(e.totalPages||1))]),t("button",{staticClass:"px-2 py-1 text-xs text-textMuted hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",attrs:{disabled:e.page>=e.totalPages},on:{click:e.nextPage}},[t("i",{staticClass:"fa-solid fa-chevron-right"})])])]),t("div",{staticClass:"flex-1 overflow-auto"},[t("table",{staticClass:"w-full text-sm"},[t("thead",{staticClass:"bg-sidebar sticky top-0"},[t("tr",e._l(e.tableInfo.columns,function(i){return t("th",{key:i.name,staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[e._v(" "+e._s(i.name)+" "),t("span",{staticClass:"text-xs font-normal text-textMuted opacity-60 ml-1"},[e._v(e._s(i.type))])])}),0)]),t("tbody",[e._l(e.tableData.rows,function(i,n){return t("tr",{key:n,staticClass:"hover:bg-white/5"},e._l(e.tableInfo.columns,function(r){return t("td",{key:r.name,staticClass:"px-3 py-1.5 text-gray-300 border-b border-border/30"},[e._v(" "+e._s(e.formatCell(i[r.name]))+" ")])}),0)}),e.tableData.rows&&e.tableData.rows.length===0?t("tr",[t("td",{staticClass:"px-3 py-8 text-center text-textMuted",attrs:{colspan:e.tableInfo.columns?e.tableInfo.columns.length:0}},[e._v(" 表中无数据 ")])]):e._e()],2)])])]):t("div",{staticClass:"flex-1 flex items-center justify-center text-textMuted"},[e._m(1)])])])},Fgt=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"flex border-b border-border text-xs uppercase font-bold text-textMuted"},[e("div",{staticClass:"px-4 py-2 border-b-2 border-accent text-white flex items-center gap-2"},[e("i",{staticClass:"fa-solid fa-database"}),s._v(" Tables ")])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fa-solid fa-database text-6xl mb-4 opacity-20"}),e("p",[s._v("选择表查看数据")])])}],Bgt=en(Ogt,Agt,Fgt,!1,null,null);const Wgt=Bgt.exports,Vgt={name:"AppLayout",computed:{isHome(){return this.$route.path==="/views/app"}}};var Hgt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"app-layout"},[e.isHome?t("header",{staticClass:"app-header"},[e._m(0)]):e._e(),t("main",{staticClass:"app-content"},[t("router-view")],1)])},$gt=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"header-left"},[e("i",{staticClass:"fa-solid fa-robot text-accent"}),e("span",[s._v("TXCode")])])}],zgt=en(Vgt,Hgt,$gt,!1,null,"ff369547");const jgt=zgt.exports,Ugt={name:"IndexViewApp",data(){return{sessions:[]}},async created(){await this.loadSessions()},methods:{goTo(s){this.$router.push(s)},async loadSessions(){try{const s=await Yt.getSessions();this.sessions=s.data||[]}catch(s){console.error("加载会话失败:",s)}},goSession(s){this.$router.push({name:"app-ChatViewApp-session",params:{id:s.id}})},async createSession(){try{const s=await Yt.createSession("新会话");this.$router.push({name:"app-ChatViewApp-session",params:{id:s.data.id}})}catch{this.$message.error("创建会话失败")}},formatTime(s){if(!s)return"";const e=new Date(s),i=new Date-e;return i<6e4?"刚刚":i<36e5?Math.floor(i/6e4)+"分钟前":i<864e5?Math.floor(i/36e5)+"小时前":i<6048e5?Math.floor(i/864e5)+"天前":e.toLocaleDateString()}}};var qgt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"index-view"},[e._m(0),t("div",{staticClass:"feature-grid"},[t("div",{staticClass:"feature-card code",on:{click:function(i){return e.goTo("/views/app/ChatViewApp")}}},[t("i",{staticClass:"fa-regular fa-comments"}),t("h3",[e._v("代码对话")]),t("p",[e._v("与 AI 对话开发")])]),t("div",{staticClass:"feature-card workflow",on:{click:function(i){return e.goTo("/views/app/DevWorkflowViewApp")}}},[t("i",{staticClass:"fa-solid fa-laptop-code"}),t("h3",[e._v("软件研发")]),t("p",[e._v("规范研发流程")])]),t("div",{staticClass:"feature-card files",on:{click:function(i){return e.goTo("/views/app/FilesViewApp")}}},[t("i",{staticClass:"fa-solid fa-folder-open"}),t("h3",[e._v("文件管理")]),t("p",[e._v("浏览项目文件")])]),t("div",{staticClass:"feature-card git",on:{click:function(i){return e.goTo("/views/app/GitChangesApp")}}},[t("i",{staticClass:"fa-brands fa-git-alt"}),t("h3",[e._v("Git变更")]),t("p",[e._v("查看代码变更")])])]),t("div",{staticClass:"section-header"},[t("h2",{staticClass:"section-title"},[e._v("最近会话")]),t("a",{staticClass:"section-more",attrs:{href:"javascript:void(0)"},on:{click:function(i){return e.goTo("/views/app/ChatViewApp")}}},[e._v("查看全部")])]),e.sessions.length>0?t("div",{staticClass:"session-list"},e._l(e.sessions.slice(0,5),function(i){return t("div",{key:i.id,staticClass:"session-item",on:{click:function(n){return e.goSession(i)}}},[e._m(1,!0),t("div",{staticClass:"session-info"},[t("h4",[e._v(e._s(i.title||"未命名会话"))]),t("p",[e._v(e._s(e.formatTime(i.updatedAt||i.createTime)))])]),t("div",{staticClass:"session-status"})])}),0):t("div",{staticClass:"empty-state"},[t("i",{staticClass:"fa-regular fa-comment-dots"}),t("p",[e._v("暂无会话记录")]),t("span",{staticClass:"start-btn",on:{click:e.createSession}},[e._v("开始新对话")])])])},Kgt=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"welcome-section"},[e("div",{staticClass:"welcome-icon"},[e("i",{staticClass:"fa-solid fa-wand-magic-sparkles"})]),e("h1",{staticClass:"welcome-title"},[s._v("你好,我是 TXCode")]),e("p",{staticClass:"welcome-subtitle"},[s._v("AI 驱动的软件开发助手")])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"session-icon"},[e("i",{staticClass:"fa-solid fa-robot"})])}],Ggt=en(Ugt,qgt,Kgt,!1,null,"b3cab99a");const Ygt=Ggt.exports,Zgt={name:"FilesViewApp",data(){return{projects:[],currentProject:null,browseResult:{current_path:"",parent_path:null,items:[]},loading:!1,contextMenu:{visible:!1,target:null},inputDialog:{visible:!1,title:"",value:"",placeholder:"",type:"",target:null},confirmDialog:{visible:!1,message:"",target:null},fileViewerVisible:!1,editingFileName:"",editingFilePath:"",fileLoading:!1,saving:!1,isBinary:!1,editor:null,originalContent:"",fileIcons:{js:"fa-brands fa-js text-yellow-400",ts:"fa-brands fa-js text-blue-400",html:"fa-brands fa-html5 text-orange-500",css:"fa-brands fa-css3 text-blue-400",json:"fa-solid fa-file-code text-yellow-300",yaml:"fa-solid fa-file-code text-blue-300",yml:"fa-solid fa-file-code text-blue-300",md:"fa-solid fa-file-lines text-gray-400",py:"fa-brands fa-python text-blue-500",vue:"fa-brands fa-vuejs text-green-400",sh:"fa-solid fa-terminal text-green-400",go:"fa-brands fa-golang text-cyan-400"}}},computed:{fileTreeData(){return this.browseResult.items.map(e=>this.transformNode(e)).sort((e,t)=>e.is_directory===t.is_directory?e.name.localeCompare(t.name):e.is_directory?-1:1)},currentDirName(){const s=this.browseResult.current_path;return s?s.split(/[/\\]/).pop()||s:"我的电脑"},hasChanges(){return this.editor?this.editor.getValue()!==this.originalContent:!1},isBinaryFile(){return this.isBinary}},async created(){await this.loadProjects(),await this.browse(""),document.addEventListener("keydown",this.handleKeydown)},beforeDestroy(){document.removeEventListener("keydown",this.handleKeydown),this.editor&&(this.editor.dispose(),this.editor=null)},methods:{async loadProjects(){try{const s=await Yt.getProjects();this.projects=s.data||[];const e=await Yt.getCurrentProject();this.currentProject=e.data||null}catch(s){console.error("Load projects failed:",s)}},async handleProjectChange(s){try{await Yt.setCurrentProject(s);const e=this.projects.find(t=>t.id===s);e&&(this.currentProject=e),location.reload()}catch(e){this.$message.error("切换项目失败: "+e.message)}},async browse(s){this.loading=!0;try{const e=await Yt.browseFilesystem(s);this.browseResult=e.data}catch(e){console.error("Browse failed:",e)}finally{this.loading=!1}},transformNode(s){return{name:s.name,path:s.path,is_directory:s.is_directory,is_drive:s.is_drive||!1,size:s.size,is_binary:s.is_binary||!1}},handleItemClick(s){s.is_directory?this.browse(s.path):this.openFileViewer(s)},toggleMenu(){this.$message.info("长安文件可进行更多操作")},async openFileItem(){this.hideContextMenu(),this.contextMenu.target&&this.openFileViewer(this.contextMenu.target)},goBack(){this.$router.back()},goUp(){if(!this.browseResult.parent_path&&this.browseResult.parent_path!=="")return;const s=this.browseResult.parent_path===""?"":this.browseResult.parent_path;this.browse(s)},async openFileViewer(s){var n,r;if(this.fileViewerVisible=!0,this.editingFileName=s.name,this.editingFilePath=s.path,this.fileLoading=!0,this.isBinary=s.is_binary||!1,this.editor=null,this.isBinary){this.fileLoading=!1;return}let e="";try{const o=await Yt.getFileContent(s.path);this.isBinary=((n=o.data)==null?void 0:n.is_binary)||!1,e=((r=o.data)==null?void 0:r.content)||""}catch(o){console.error("Load file failed:",o),this.fileLoading=!1;return}if(this.fileLoading=!1,this.isBinary||(await this.$nextTick(),!this.$refs.editorContainer))return;this.editor=$b.create(this.$refs.editorContainer,{value:"",language:"plaintext",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:16,fontFamily:'Consolas, Monaco, "Courier New", monospace',lineNumbers:"on",roundedSelection:!1,scrollbar:{useShadows:!1,vertical:"auto",horizontal:"auto"}}),this.editor.onDidChangeModelContent(()=>{this.$forceUpdate()}),this.editor.addCommand(l3.CtrlCmd|a3.KeyS,()=>{this.saveFile()});const t=this.getLanguageFromFilename(s.name),i=$b.createModel(e,t);this.editor.setModel(i),this.originalContent=e},closeFileViewer(){this.editor&&(this.editor.dispose(),this.editor=null),this.fileViewerVisible=!1},async saveFile(){if(!(!this.editor||this.saving)){this.saving=!0;try{const s=this.editor.getValue();await Yt.writeFile(this.editingFilePath,s),this.originalContent=s,this.$message.success("已保存")}catch(s){console.error("Save failed:",s),this.$message.error("保存失败")}finally{this.saving=!1}}},initEditor(){this.editor||!this.$refs.editorContainer||(this.editor=$b.create(this.$refs.editorContainer,{value:"",language:"plaintext",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:16,fontFamily:'Consolas, Monaco, "Courier New", monospace',lineNumbers:"on"}),this.editor.addCommand(l3.CtrlCmd|a3.KeyS,()=>{this.saveFile()}))},showContextMenu(s,e){s.stopPropagation(),this.contextMenu={visible:!0,target:e}},hideContextMenu(){this.contextMenu.visible=!1},copyPath(){this.hideContextMenu(),this.contextMenu.target&&(navigator.clipboard.writeText(this.contextMenu.target.path),this.$message.success("路径已复制"))},createNewFile(){this.hideContextMenu(),this.inputDialog={visible:!0,title:"新建文件",value:"",placeholder:"输入文件名",type:"file",target:this.contextMenu.target},this.$nextTick(()=>{var s;(s=this.$refs.dialogInput)==null||s.focus()})},createNewFolder(){this.hideContextMenu(),this.inputDialog={visible:!0,title:"新建文件夹",value:"",placeholder:"输入文件夹名",type:"folder",target:this.contextMenu.target},this.$nextTick(()=>{var s;(s=this.$refs.dialogInput)==null||s.focus()})},renameItem(){this.hideContextMenu(),this.inputDialog={visible:!0,title:"重命名",value:this.contextMenu.target.name,placeholder:"输入新名称",type:"rename",target:this.contextMenu.target},this.$nextTick(()=>{var s,e;(s=this.$refs.dialogInput)==null||s.focus(),(e=this.$refs.dialogInput)==null||e.select()})},async confirmInput(){const{type:s,value:e,target:t}=this.inputDialog;if(!e.trim()){this.cancelInput();return}try{const i=t.path.includes("\\")?"\\":"/";if(s==="file"){const n=t.path+i+e.trim();await Yt.writeFile(n,"")}else if(s==="folder"){const n=t.path+i+e.trim();await Yt.createDirectory(n)}else if(s==="rename"){const r=t.path.substring(0,t.path.lastIndexOf(i))+i+e.trim();await Yt.renameFile(t.path,r)}this.browse(this.browseResult.current_path)}catch(i){console.error("Operation failed:",i),this.$message.error("操作失败")}this.inputDialog.visible=!1},cancelInput(){this.inputDialog.visible=!1},deleteItem(){this.hideContextMenu(),this.confirmDialog={visible:!0,message:`确定要删除 "${this.contextMenu.target.name}" 吗?`,target:this.contextMenu.target}},cancelConfirm(){this.confirmDialog.visible=!1},async confirmDelete(){try{await Yt.deleteFile(this.confirmDialog.target.path),this.$message.success("删除成功"),this.browse(this.browseResult.current_path)}catch(s){console.error("Delete failed:",s),this.$message.error("删除失败")}this.confirmDialog.visible=!1},handleKeydown(s){s.ctrlKey&&s.key==="s"&&this.fileViewerVisible&&(s.preventDefault(),this.saveFile())},getItemIcon(s){if(s.is_directory)return"fa-solid fa-folder text-blue-400";const e=s.name.split(".").pop().toLowerCase(),t=s.name.toLowerCase();return t==="dockerfile"?"fa-brands fa-docker text-blue-400":t===".gitignore"?"fa-brands fa-git text-red-400":this.fileIcons[e]||"fa-solid fa-file text-gray-400"},getLanguageFromFilename(s){const e=s.split(".").pop().toLowerCase();return{js:"javascript",ts:"typescript",html:"html",css:"css",vue:"html",py:"python",md:"markdown",json:"json",yaml:"yaml",yml:"yaml",xml:"xml",sql:"sql",sh:"shell",go:"go",rs:"rust"}[e]||"plaintext"}}};var Xgt=function(){var i,n,r,o;var e=this,t=e._self._c;return t("div",{staticClass:"h-full flex flex-col bg-[#1e1e1e]"},[t("div",{staticClass:"bg-sidebar border-b border-border px-4 py-3 flex items-center justify-between shrink-0"},[t("div",{staticClass:"flex items-center gap-2"},[t("button",{staticClass:"p-2 text-textMuted hover:text-white",attrs:{title:"返回"},on:{click:e.goBack}},[t("i",{staticClass:"fa-solid fa-chevron-left"})]),t("button",{staticClass:"p-2 text-textMuted hover:text-white disabled:opacity-30",attrs:{disabled:!e.browseResult.parent_path&&e.browseResult.parent_path!=="",title:"上级目录"},on:{click:e.goUp}},[t("i",{staticClass:"fa-solid fa-arrow-up"})])]),t("div",{staticClass:"flex items-center gap-2"},[e.projects.length>0?t("el-dropdown",{attrs:{trigger:"click"},on:{command:e.handleProjectChange}},[t("span",{staticClass:"text-sm text-white cursor-pointer hover:text-accent"},[e._v(" "+e._s(((i=e.currentProject)==null?void 0:i.name)||"选择项目")+" "),t("i",{staticClass:"fa-solid fa-chevron-down ml-1 text-xs"})]),t("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.projects,function(a){var l;return t("el-dropdown-item",{key:a.id,attrs:{command:a.id}},[t("span",{class:a.id===((l=e.currentProject)==null?void 0:l.id)?"text-accent":""},[e._v(e._s(a.name))])])}),1)],1):e._e()],1),t("button",{staticClass:"p-2 text-textMuted hover:text-white",on:{click:e.toggleMenu}},[t("i",{staticClass:"fa-solid fa-ellipsis-v"})])]),t("div",{staticClass:"flex-1 overflow-y-auto"},[e.loading?t("div",{staticClass:"flex flex-col items-center justify-center h-full text-textMuted"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin text-2xl mb-2"}),t("span",{staticClass:"text-sm"},[e._v("加载中...")])]):e.fileTreeData.length===0?t("div",{staticClass:"flex flex-col items-center justify-center h-full text-textMuted"},[t("i",{staticClass:"fa-solid fa-folder-open text-4xl mb-2 opacity-30"}),t("span",{staticClass:"text-sm"},[e._v("此目录为空")])]):t("div",{staticClass:"divide-y divide-border"},e._l(e.fileTreeData,function(a){return t("div",{key:a.path,staticClass:"flex items-center px-4 py-3 active:bg-active",on:{click:function(l){return e.handleItemClick(a)}}},[t("i",{staticClass:"text-lg w-8 text-center",class:e.getItemIcon(a)}),t("span",{staticClass:"flex-1 text-sm text-white ml-2 truncate"},[e._v(e._s(a.name))]),a.is_directory?t("i",{staticClass:"fa-solid fa-chevron-right text-textMuted text-xs"}):e._e()])}),0)]),e.contextMenu.visible?t("div",{staticClass:"fixed inset-0 bg-black/50 z-50",on:{click:e.hideContextMenu}},[t("div",{staticClass:"absolute bottom-0 left-0 right-0 bg-sidebar rounded-t-xl p-4",on:{click:function(a){a.stopPropagation()}}},[t("div",{staticClass:"w-12 h-1 bg-gray-500 rounded-full mx-auto mb-4"}),t("div",{staticClass:"space-y-1"},[(n=e.contextMenu.target)!=null&&n.is_directory?t("button",{staticClass:"w-full flex items-center gap-3 px-4 py-3 text-white text-sm active:bg-active rounded-lg",on:{click:e.createNewFile}},[t("i",{staticClass:"fa-solid fa-file-lines w-5"}),e._v(" 新建文件 ")]):e._e(),(r=e.contextMenu.target)!=null&&r.is_directory?t("button",{staticClass:"w-full flex items-center gap-3 px-4 py-3 text-white text-sm active:bg-active rounded-lg",on:{click:e.createNewFolder}},[t("i",{staticClass:"fa-solid fa-folder-plus w-5"}),e._v(" 新建文件夹 ")]):e._e(),t("button",{staticClass:"w-full flex items-center gap-3 px-4 py-3 text-white text-sm active:bg-active rounded-lg",on:{click:e.copyPath}},[t("i",{staticClass:"fa-solid fa-copy w-5"}),e._v(" 复制路径 ")]),(o=e.contextMenu.target)!=null&&o.is_directory?e._e():t("button",{staticClass:"w-full flex items-center gap-3 px-4 py-3 text-white text-sm active:bg-active rounded-lg",on:{click:e.openFileItem}},[t("i",{staticClass:"fa-solid fa-folder-open w-5"}),e._v(" 打开文件 ")]),t("button",{staticClass:"w-full flex items-center gap-3 px-4 py-3 text-white text-sm active:bg-active rounded-lg",on:{click:e.renameItem}},[t("i",{staticClass:"fa-solid fa-pen w-5"}),e._v(" 重命名 ")]),t("button",{staticClass:"w-full flex items-center gap-3 px-4 py-3 text-red-400 text-sm active:bg-active rounded-lg",on:{click:e.deleteItem}},[t("i",{staticClass:"fa-solid fa-trash w-5"}),e._v(" 删除 ")])])])]):e._e(),e.inputDialog.visible?t("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",on:{click:function(a){return a.target!==a.currentTarget?null:e.cancelInput.apply(null,arguments)}}},[t("div",{staticClass:"w-full max-w-sm bg-sidebar border border-border rounded-xl p-4"},[t("p",{staticClass:"text-white text-base mb-4"},[e._v(e._s(e.inputDialog.title))]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.inputDialog.value,expression:"inputDialog.value"}],ref:"dialogInput",staticClass:"w-full px-4 py-3 bg-[#1e1e1e] border border-border rounded-lg text-white text-sm focus:outline-none focus:border-accent",attrs:{placeholder:e.inputDialog.placeholder},domProps:{value:e.inputDialog.value},on:{keyup:[function(a){return!a.type.indexOf("key")&&e._k(a.keyCode,"enter",13,a.key,"Enter")?null:e.confirmInput.apply(null,arguments)},function(a){return!a.type.indexOf("key")&&e._k(a.keyCode,"escape",void 0,a.key,void 0)?null:e.cancelInput.apply(null,arguments)}],input:function(a){a.target.composing||e.$set(e.inputDialog,"value",a.target.value)}}}),t("div",{staticClass:"flex gap-3 mt-4"},[t("button",{staticClass:"flex-1 py-3 text-textMuted text-sm rounded-lg",on:{click:e.cancelInput}},[e._v("取消")]),t("button",{staticClass:"flex-1 py-3 bg-accent text-white text-sm rounded-lg",on:{click:e.confirmInput}},[e._v("确定")])])])]):e._e(),e.fileViewerVisible?t("div",{staticClass:"fixed inset-0 bg-black/50 z-50",on:{click:function(a){return a.target!==a.currentTarget?null:e.closeFileViewer.apply(null,arguments)}}},[t("div",{staticClass:"absolute bottom-0 left-0 right-0 bg-[#1e1e1e] rounded-t-2xl flex flex-col",staticStyle:{height:"85vh"}},[e._m(0),t("div",{staticClass:"bg-sidebar border-b border-border px-4 py-2 flex items-center justify-between shrink-0"},[t("span",{staticClass:"text-sm text-white truncate"},[e._v(e._s(e.editingFileName))]),t("div",{staticClass:"flex items-center gap-2"},[t("button",{staticClass:"p-2 text-accent disabled:opacity-50",attrs:{disabled:!e.hasChanges||e.saving,title:"保存"},on:{click:e.saveFile}},[e.saving?t("i",{staticClass:"fa-solid fa-spinner fa-spin"}):t("i",{staticClass:"fa-solid fa-save"})]),t("button",{staticClass:"p-2 text-textMuted hover:text-white",attrs:{title:"关闭"},on:{click:e.closeFileViewer}},[t("i",{staticClass:"fa-solid fa-times"})])])]),t("div",{staticClass:"flex-1 overflow-hidden"},[e.fileLoading?t("div",{staticClass:"flex items-center justify-center h-full text-textMuted"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.isBinary?t("div",{staticClass:"flex items-center justify-center h-full text-textMuted"},[e._m(1)]):t("div",{ref:"editorContainer",staticClass:"w-full h-full monaco-editor-container"})]),e.hasChanges&&!e.isBinary?t("div",{staticClass:"bg-yellow-600/20 border-t border-yellow-600/30 px-4 py-2 text-yellow-500 text-sm text-center shrink-0"},[e._v(" 文件已修改,Ctrl+S 保存 ")]):e._e()])]):e._e(),e.confirmDialog.visible?t("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4"},[t("div",{staticClass:"w-full max-w-sm bg-sidebar border border-border rounded-xl p-4"},[t("p",{staticClass:"text-white text-base mb-4"},[e._v(e._s(e.confirmDialog.message))]),t("div",{staticClass:"flex gap-3"},[t("button",{staticClass:"flex-1 py-3 text-textMuted text-sm rounded-lg",on:{click:e.cancelConfirm}},[e._v("取消")]),t("button",{staticClass:"flex-1 py-3 bg-red-500 text-white text-sm rounded-lg",on:{click:e.confirmDelete}},[e._v("删除")])])])]):e._e()])},Qgt=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"flex justify-center pt-3 pb-1 shrink-0"},[e("div",{staticClass:"w-10 h-1 bg-gray-500 rounded-full"})])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fa-solid fa-file text-4xl mb-4 opacity-30"}),e("p",[s._v("二进制文件无法预览")])])}],Jgt=en(Zgt,Xgt,Qgt,!1,null,"d8b2d27d");const ept=Jgt.exports,tpt={name:"FileTreeNode",props:{node:{type:Object,required:!0},selectedPath:{type:String,default:""}},data(){return{loading:!1}},methods:{async toggleExpand(){this.node.is_directory&&(!this.node.expanded&&this.node.children.length===0?(this.node.loading=!0,this.$emit("load-children",this.node)):this.node.expanded=!this.node.expanded)},handleClick(){this.node.is_directory?this.toggleExpand():this.$emit("select-node",this.node)},handleLoadChildren(s){this.$emit("load-children",s)},handleSelectNode(s){this.$emit("select-node",s)},getFileIcon(s,e){if(e)return"fa-solid fa-folder";const t=s.split(".").pop().toLowerCase(),i=s.toLowerCase(),n={js:"fa-brands fa-js",jsx:"fa-brands fa-react",ts:"fa-brands fa-js",tsx:"fa-brands fa-react",vue:"fa-brands fa-vuejs",py:"fa-brands fa-python",html:"fa-brands fa-html5",htm:"fa-brands fa-html5",css:"fa-brands fa-css3",scss:"fa-brands fa-sass",json:"fa-solid fa-file-code",yaml:"fa-solid fa-file-code",yml:"fa-solid fa-file-code",md:"fa-solid fa-file-lines",sql:"fa-solid fa-database",sh:"fa-solid fa-terminal",go:"fa-brands fa-golang",java:"fa-brands fa-java",dockerfile:"fa-brands fa-docker"};return i==="dockerfile"?"fa-brands fa-docker":i===".gitignore"?"fa-brands fa-git":n[t]||"fa-solid fa-file"}}};var ipt=function(){var e=this,t=e._self._c;return t("div",{staticClass:"file-tree-node"},[t("div",{staticClass:"node-row",class:{selected:e.selectedPath===e.node.path},on:{click:e.handleClick}},[e.node.is_directory?t("span",{staticClass:"expand-icon",on:{click:function(i){return i.stopPropagation(),e.toggleExpand.apply(null,arguments)}}},[e.node.loading?t("i",{staticClass:"fa-solid fa-spinner fa-spin"}):e.node.expanded?t("i",{staticClass:"fa-solid fa-chevron-down"}):t("i",{staticClass:"fa-solid fa-chevron-right"})]):t("span",{staticClass:"expand-icon placeholder"}),t("span",{staticClass:"node-icon"},[t("i",{class:e.getFileIcon(e.node.name,e.node.is_directory)})]),t("span",{staticClass:"node-name"},[e._v(e._s(e.node.name))])]),e.node.is_directory&&e.node.expanded&&e.node.children&&e.node.children.length>0?t("div",{staticClass:"node-children"},e._l(e.node.children,function(i){return t("FileTreeNode",{key:i.path,attrs:{node:i,"selected-path":e.selectedPath},on:{"load-children":e.handleLoadChildren,"select-node":e.handleSelectNode}})}),1):e._e()])},npt=[],spt=en(tpt,ipt,npt,!1,null,"95a2c18b");const rpt=spt.exports,opt={name:"FileSelectDrawer",components:{FileTreeNode:rpt},props:{visible:{type:Boolean,default:!1}},data(){return{currentPath:"",parentPath:null,fileTreeData:[],selectedPath:"",loading:!1}},computed:{canGoUp(){return this.parentPath!==null&&this.parentPath!==void 0}},watch:{visible(s){s?this.loadFileTree(""):this.reset()}},methods:{reset(){this.currentPath="",this.parentPath=null,this.fileTreeData=[],this.selectedPath="",this.loading=!1},async loadFileTree(s=""){var e,t,i;this.loading=!0;try{const n=await Yt.browseFilesystem(s);this.currentPath=((e=n.data)==null?void 0:e.current_path)||s,this.parentPath=(t=n.data)==null?void 0:t.parent_path;const r=(((i=n.data)==null?void 0:i.items)||[]).map(o=>this.transformNode(o));r.sort((o,a)=>o.is_directory===a.is_directory?o.name.localeCompare(a.name):o.is_directory?-1:1),this.fileTreeData=r}catch(n){console.error("加载文件树失败:",n),this.fileTreeData=[]}finally{this.loading=!1}},transformNode(s){return{name:s.name,path:s.path,is_directory:s.is_directory,has_children:s.is_directory,expanded:!1,children:[],loading:!1}},async onLoadChildren(s){var e;try{const i=(((e=(await Yt.browseFilesystem(s.path)).data)==null?void 0:e.items)||[]).map(n=>this.transformNode(n));i.sort((n,r)=>n.is_directory===r.is_directory?n.name.localeCompare(r.name):n.is_directory?-1:1),s.children=i,s.expanded=!0}catch(t){console.error("加载子目录失败:",t),s.children=[],s.expanded=!0}finally{s.loading=!1}},onSelectNode(s){this.selectedPath=s.path},goUp(){this.parentPath!==null&&this.parentPath!==void 0&&this.loadFileTree(this.parentPath===""?"":this.parentPath)},goHome(){this.loadFileTree("")},handleConfirm(){this.selectedPath&&(this.$emit("select",this.selectedPath),this.$emit("close"))},handleClose(){this.$emit("close")},getFileIcon(s,e){if(e)return"fa-solid fa-folder";const t=s.split(".").pop().toLowerCase(),i=s.toLowerCase(),n={js:"fa-brands fa-js",jsx:"fa-brands fa-react",ts:"fa-brands fa-js",tsx:"fa-brands fa-react",vue:"fa-brands fa-vuejs",py:"fa-brands fa-python",html:"fa-brands fa-html5",htm:"fa-brands fa-html5",css:"fa-brands fa-css3",scss:"fa-brands fa-sass",json:"fa-solid fa-file-code",yaml:"fa-solid fa-file-code",yml:"fa-solid fa-file-code",md:"fa-solid fa-file-lines",sql:"fa-solid fa-database",sh:"fa-solid fa-terminal",go:"fa-brands fa-golang",java:"fa-brands fa-java",dockerfile:"fa-brands fa-docker"};return i==="dockerfile"?"fa-brands fa-docker":i===".gitignore"?"fa-brands fa-git":n[t]||"fa-solid fa-file"}}};var apt=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"drawer-overlay",class:{show:e.visible},on:{click:e.handleClose}}),t("div",{staticClass:"file-drawer",class:{show:e.visible}},[t("div",{staticClass:"drawer-header"},[t("span",{staticClass:"drawer-title",staticStyle:{color:"#f4f4f5"}},[e._v("选择文件")]),t("button",{staticClass:"drawer-close",on:{click:e.handleClose}},[t("i",{staticClass:"fa-solid fa-xmark"})])]),t("div",{staticClass:"file-toolbar"},[t("button",{staticClass:"toolbar-btn",attrs:{disabled:!e.canGoUp},on:{click:e.goUp}},[t("i",{staticClass:"fa-solid fa-arrow-up"})]),t("button",{staticClass:"toolbar-btn",on:{click:e.goHome}},[t("i",{staticClass:"fa-solid fa-home"})]),t("div",{staticClass:"file-path"},[e._v(e._s(e.currentPath||"/"))])]),t("div",{staticClass:"file-tree-container"},[e.loading?t("div",{staticClass:"file-loading"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin"}),e._v(" 加载中... ")]):e.fileTreeData.length===0?t("div",{staticClass:"file-empty"},[e._v(" 此目录为空 ")]):e._l(e.fileTreeData,function(i){return t("FileTreeNode",{key:i.path,attrs:{node:i,"selected-path":e.selectedPath},on:{"load-children":e.onLoadChildren,"select-node":e.onSelectNode}})})],2),t("div",{staticClass:"drawer-footer"},[t("div",{staticClass:"selected-path"},[e._v(e._s(e.selectedPath||"未选择"))]),t("button",{staticClass:"confirm-btn",attrs:{disabled:!e.selectedPath},on:{click:e.handleConfirm}},[e._v("选择")])])])])},lpt=[],cpt=en(opt,apt,lpt,!1,null,"bde2b0c6");const dpt=cpt.exports,upt={name:"ChatViewApp",components:{FileSelectDrawer:dpt},data(){return{sessions:[],currentSessionId:null,currentSession:null,logItems:[],inputMessage:"",isProcessing:!1,modelName:"",promptTokens:0,showSessionDrawer:!1,showModelDrawer:!1,showCommandDrawer:!1,showFileDrawer:!1,searchKeyword:"",models:[],logSeq:0,wsUnsubscribe:null}},computed:{filteredSessions(){if(!this.searchKeyword)return this.sessions;const s=this.searchKeyword.toLowerCase();return this.sessions.filter(e=>(e.title||"").toLowerCase().includes(s))}},async created(){this.initGlobalWs(),await this.loadSessions(),await this.loadModels(),await this.loadDefaultModel();const s=this.$route.params.id;if(s){const e=this.sessions.find(t=>t.id===s);e&&await this.selectSession(e,!1)}},activated(){this.currentSessionId&&this.subscribeSession()},deactivated(){this.wsUnsubscribe&&(this.wsUnsubscribe(),this.wsUnsubscribe=null)},methods:{goBack(){this.$router.push("/views/app")},initGlobalWs(){Cd.init()},closeAllDrawers(){this.showSessionDrawer=!1,this.showModelDrawer=!1,this.showCommandDrawer=!1,this.showFileDrawer=!1},renderMarkdown(s){return s?Gn(s):""},getTodoStatusIcon(s){return{completed:"✅",in_progress:"🔄",pending:"⬜",cancelled:"❌"}[s]||"⬜"},getToolCallName(s){var e;return((e=s==null?void 0:s.function)==null?void 0:e.name)||"unknown"},formatToolArgs(s){var e,t,i;try{const n=JSON.parse(((e=s==null?void 0:s.function)==null?void 0:e.arguments)||"{}");return n.file_path?n.file_path:n.command?n.command:((t=s==null?void 0:s.function)==null?void 0:t.arguments)||""}catch{return((i=s==null?void 0:s.function)==null?void 0:i.arguments)||""}},async loadSessions(){try{const s=await ive();this.sessions=s.data||[]}catch(s){console.error("加载会话失败:",s)}},async loadModels(){try{const s=await Yt.getModels();this.models=s.data||[]}catch(s){console.error("加载模型失败:",s)}},async loadDefaultModel(){var s;try{const e=await Yt.getConfig("defaultModel");(s=e.data)!=null&&s.value&&(this.modelName=e.data.value)}catch{this.modelName="gpt-4o"}},async selectSession(s,e=!0){this.wsUnsubscribe&&(this.wsUnsubscribe(),this.wsUnsubscribe=null),this.currentSession=s,this.currentSessionId=s.id,this.logItems=[],this.isProcessing=s.status==="processing",e&&this.$route.params.id!==s.id&&this.$router.push({name:"app-ChatViewApp-session",params:{id:s.id}}).catch(()=>{}),await this.loadMessages(),this.subscribeSession(),this.showSessionDrawer=!1},async loadMessages(){try{const s=await sve(this.currentSessionId);this.logItems=(s.data||[]).map(e=>e.type==="think"?{type:"think",content:e.content||"",_id:`log-${++this.logSeq}`}:e.type==="step"?{type:"step",thought:e.thought,toolCalls:e.toolCalls||[],success:e.success,_id:`log-${++this.logSeq}`}:e.type==="chat"?{type:"chat",content:e.content,_id:`log-${++this.logSeq}`}:e.type==="todos"?{type:"todos",todos:e.todos||[],_id:`log-${++this.logSeq}`}:{type:"system",content:String(e),_id:`log-${++this.logSeq}`}),this.scrollToBottom()}catch(s){console.error("加载消息失败:",s)}},subscribeSession(){this.currentSessionId&&(this.wsUnsubscribe&&this.wsUnsubscribe(),this.wsUnsubscribe=Cd.subscribe(this.currentSessionId,{running_sessions:s=>{const e=(s==null?void 0:s.runningSessionIds)||[];this.updateSessionStatus(e)},todos:s=>{this.logItems.push({type:"todos",todos:s.todos,_id:`log-${++this.logSeq}`}),this.scrollToBottom()},session:s=>{s!=null&&s.sessionId&&!this.currentSessionId&&(this.currentSessionId=s.sessionId)},step:s=>{var e;this.logItems.push({type:"step",thought:s==null?void 0:s.thought,toolCalls:(s==null?void 0:s.toolCalls)||[],success:s==null?void 0:s.success,_id:`log-${++this.logSeq}`}),(e=s==null?void 0:s.usage)!=null&&e.promptTokens&&(this.promptTokens=s.usage.promptTokens),this.scrollToBottom()},compact:s=>{this.logItems.push({type:"system",content:`【压缩完成】${s.summary||""}`,_id:`log-${++this.logSeq}`}),this.loadSessions(),this.loadMessages()},done:s=>{var e;this.isProcessing=!1,s!=null&&s.modelName&&(this.modelName=s.modelName),(e=s==null?void 0:s.usage)!=null&&e.promptTokens&&(this.promptTokens=s.usage.promptTokens),s!=null&&s.response&&this.logItems.push({type:"think",content:s.response,_id:`log-${++this.logSeq}`}),this.loadSessions(),this.scrollToBottom()},stopped:()=>{this.isProcessing=!1,this.logItems.push({type:"think",content:"【已停止】",_id:`log-${++this.logSeq}`}),this.scrollToBottom()},error:s=>{this.isProcessing=!1,this.$message.error((s==null?void 0:s.error)||"发生错误")}}))},updateSessionStatus(s){new Set(s||[]).has(this.currentSessionId)?this.isProcessing=!0:this.isProcessing=!1},async createSession(){try{const s=await nve("新会话");this.sessions.unshift(s.data),await this.selectSession(s.data)}catch(s){this.$message.error("创建会话失败: "+s.message)}},sendMessage(){if(!this.inputMessage.trim()||this.isProcessing)return;if(!this.currentSessionId){this.createSession().then(()=>this.sendMessage());return}const s=this.inputMessage.trim();this.inputMessage="",this.isProcessing=!0,this.logItems.push({type:"chat",content:s,_id:`log-${++this.logSeq}`}),this.scrollToBottom(),Cd.send("chat",{message:s,sessionId:this.currentSessionId,modelName:this.modelName||void 0})},stopGeneration(){this.currentSessionId&&(this.isProcessing=!1,Cd.send("stop",{sessionId:this.currentSessionId}))},appendCommand(s){var e;this.inputMessage=s+" ",(e=this.$refs.inputField)==null||e.focus()},openFileSelect(){this.showFileDrawer=!0},onFileSelected(s){var e;this.inputMessage=this.inputMessage+s+" ",this.showFileDrawer=!1,(e=this.$refs.inputField)==null||e.focus()},selectModel(s){const e=s.name.split("/");this.modelName=e.length>2?e.slice(1).join("/"):s.name,Yt.setConfig("defaultModel",this.modelName),this.showModelDrawer=!1},formatTime(s){if(!s)return"";const e=new Date(s),i=new Date-e;return i<6e4?"刚刚":i<36e5?Math.floor(i/6e4)+"分钟前":i<864e5?"今天 "+e.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}):i<6048e5?Math.floor(i/864e5)+"天前":e.toLocaleDateString()},scrollToBottom(){this.$nextTick(()=>{this.$refs.chatArea&&(this.$refs.chatArea.scrollTop=this.$refs.chatArea.scrollHeight)})}}};var hpt=function(){var i;var e=this,t=e._self._c;return t("div",{staticClass:"app-container"},[t("header",{staticClass:"header"},[t("a",{staticClass:"header-back",attrs:{href:"#"},on:{click:function(n){return n.preventDefault(),e.goBack.apply(null,arguments)}}},[t("i",{staticClass:"fa-solid fa-chevron-left"})]),t("div",{staticClass:"session-switch-btn",on:{click:function(n){e.showSessionDrawer=!0}}},[t("i",{staticClass:"fa-solid fa-comments"}),t("span",{staticClass:"title"},[e._v(e._s(((i=e.currentSession)==null?void 0:i.title)||"新会话"))]),t("i",{staticClass:"fa-solid fa-chevron-down arrow"})]),t("div",{staticClass:"header-actions"},[t("a",{staticClass:"header-btn",attrs:{href:"#",title:"命令"},on:{click:function(n){n.preventDefault(),e.showCommandDrawer=!0}}},[t("i",{staticClass:"fa-solid fa-terminal"})])])]),t("div",{staticClass:"model-selector"},[t("span",[e._v("模型")]),t("span",{staticClass:"model-name",on:{click:function(n){e.showModelDrawer=!0}}},[e._v(e._s(e.modelName||"gpt-4o"))]),t("span",{staticClass:"model-change",staticStyle:{color:"var(--accent)","font-size":"12px"},on:{click:function(n){e.showModelDrawer=!0}}},[e._v("切换")])]),t("div",{ref:"chatArea",staticClass:"chat-area"},[e.logItems.length===0?t("div",{staticClass:"empty-state"},[e._m(0),t("div",{staticClass:"empty-title"},[e._v("开始对话")]),t("div",{staticClass:"empty-desc"},[e._v("选择或创建会话开始对话")])]):e._e(),e._l(e.logItems,function(n,r){return[n.type==="chat"?[t("div",{staticClass:"message user"},[t("div",{staticClass:"message-bubble"},[e._v(e._s(n.content))])])]:n.type==="think"?[t("div",{staticClass:"message assistant"},[t("div",{staticClass:"message-bubble",domProps:{innerHTML:e._s(e.renderMarkdown(n.content))}})])]:n.type==="todos"?[t("div",{staticClass:"message assistant"},[t("div",{staticClass:"todo-list"},e._l(n.todos,function(o,a){return t("div",{key:a,staticClass:"todo-item"},[t("span",{staticClass:"todo-status"},[e._v(e._s(e.getTodoStatusIcon(o.status)))]),t("span",[e._v(e._s(o.name))])])}),0)])]:n.type==="step"?[n.thought?t("div",{staticClass:"message assistant"},[t("div",{staticClass:"message-bubble",domProps:{innerHTML:e._s(e.renderMarkdown(n.thought))}})]):e._e(),e._l(n.toolCalls,function(o,a){return t("div",{key:"tc-"+a,staticClass:"tool-log",class:n.success!==!1?"tool-success":"tool-fail"},[t("span",[e._v(e._s(n.success!==!1?"✓":"✗"))]),t("span",{staticClass:"tool-name"},[e._v(e._s(e.getToolCallName(o)))]),t("span",{staticClass:"tool-args"},[e._v(e._s(e.formatToolArgs(o)))])])})]:n.type==="system"?[t("div",{staticClass:"message assistant"},[t("div",{staticClass:"message-bubble"},[e._v(e._s(n.content))])])]:e._e()]}),e.isProcessing?t("div",{staticClass:"message assistant thinking"},[t("div",{staticClass:"message-bubble"},[e._v("思考中...")])]):e._e()],2),t("div",{staticClass:"input-area"},[t("div",{staticClass:"input-container"},[t("div",{staticClass:"input-wrapper"},[t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.inputMessage,expression:"inputMessage"}],ref:"inputField",staticClass:"input-field",attrs:{placeholder:"输入消息... (Enter 发送)"},domProps:{value:e.inputMessage},on:{keydown:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")||n.ctrlKey||n.shiftKey||n.altKey||n.metaKey?null:(n.preventDefault(),e.sendMessage.apply(null,arguments))},input:function(n){n.target.composing||(e.inputMessage=n.target.value)}}})]),t("button",{staticClass:"send-btn",class:{"stop-btn":e.isProcessing},attrs:{disabled:!e.inputMessage.trim()&&!e.isProcessing},on:{click:function(n){e.isProcessing?e.stopGeneration():e.sendMessage()}}},[t("i",{class:e.isProcessing?"fa-solid fa-stop":"fa-solid fa-paper-plane"})])]),t("div",{staticClass:"command-quick"},[t("div",{staticClass:"command-chip",on:{click:function(n){return e.appendCommand("/compact")}}},[t("i",{staticClass:"fa-solid fa-compress-alt"}),e._v(" 压缩会话 ")]),t("div",{staticClass:"command-chip",on:{click:function(n){e.showFileDrawer=!0}}},[t("i",{staticClass:"fa-solid fa-file-circle-plus"}),e._v(" 选择文件 ")])])]),t("div",{staticClass:"status-bar"},[t("div",{staticClass:"status-indicator"},[t("span",{staticClass:"status-dot",class:{processing:e.isProcessing}}),t("span",{class:{"status-processing":e.isProcessing,"status-ready":!e.isProcessing}},[e._v(e._s(e.isProcessing?"处理中...":"就绪"))])]),t("span",[e._v("Token: "+e._s(e.promptTokens||0))])]),t("div",{staticClass:"drawer-overlay",class:{show:e.showSessionDrawer||e.showModelDrawer||e.showCommandDrawer},on:{click:e.closeAllDrawers}}),t("FileSelectDrawer",{attrs:{visible:e.showFileDrawer},on:{select:e.onFileSelected,close:function(n){e.showFileDrawer=!1}}}),t("div",{staticClass:"session-drawer",class:{show:e.showSessionDrawer}},[t("div",{staticClass:"drawer-header"},[t("span",{staticClass:"drawer-title",staticStyle:{color:"var(--text-primary, #f4f4f5)"}},[e._v("选择会话")]),t("button",{staticClass:"drawer-close",on:{click:function(n){e.showSessionDrawer=!1}}},[t("i",{staticClass:"fa-solid fa-xmark"})])]),t("div",{staticClass:"drawer-search"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.searchKeyword,expression:"searchKeyword"}],staticClass:"search-input",attrs:{type:"text",placeholder:"搜索会话..."},domProps:{value:e.searchKeyword},on:{input:function(n){n.target.composing||(e.searchKeyword=n.target.value)}}})]),t("div",{staticClass:"session-list"},e._l(e.filteredSessions,function(n){return t("div",{key:n.id,staticClass:"session-list-item",class:{active:n.id===e.currentSessionId},on:{click:function(r){return e.selectSession(n)}}},[e._m(1,!0),t("div",{staticClass:"session-list-info"},[t("div",{staticClass:"session-list-title"},[e._v(e._s(n.title||"未命名会话"))]),t("div",{staticClass:"session-list-meta"},[e._v(e._s(e.formatTime(n.updatedAt||n.createTime)))])]),t("div",{staticClass:"session-list-status",class:{processing:n.status==="processing"}})])}),0),t("div",{staticClass:"drawer-footer"},[t("button",{staticClass:"new-session-btn",on:{click:e.createSession}},[t("i",{staticClass:"fa-solid fa-plus"}),e._v(" 新建会话 ")])])]),t("div",{staticClass:"session-drawer",class:{show:e.showModelDrawer}},[t("div",{staticClass:"drawer-header"},[t("span",{staticClass:"drawer-title",staticStyle:{color:"var(--text-primary, #f4f4f5)"}},[e._v("选择模型")]),t("button",{staticClass:"drawer-close",on:{click:function(n){e.showModelDrawer=!1}}},[t("i",{staticClass:"fa-solid fa-xmark"})])]),t("div",{staticClass:"command-list"},e._l(e.models,function(n){return t("div",{key:n.id,staticClass:"command-item",class:{active:n.name===e.modelName},on:{click:function(r){return e.selectModel(n)}}},[e._m(2,!0),t("div",{staticClass:"command-info"},[t("div",{staticClass:"command-name"},[e._v(e._s(n.name))]),t("div",{staticClass:"command-desc"},[e._v(e._s(n.provider||"默认"))])])])}),0)]),t("div",{staticClass:"command-drawer",class:{show:e.showCommandDrawer}},[t("div",{staticClass:"drawer-header"},[t("span",{staticClass:"drawer-title",staticStyle:{color:"var(--text-primary, #f4f4f5)"}},[e._v("快捷命令")]),t("button",{staticClass:"drawer-close",on:{click:function(n){e.showCommandDrawer=!1}}},[t("i",{staticClass:"fa-solid fa-xmark"})])]),t("div",{staticClass:"command-list"},[t("div",{staticClass:"command-item",on:{click:function(n){e.appendCommand("/compact"),e.showCommandDrawer=!1}}},[e._m(3),e._m(4)]),t("div",{staticClass:"command-item",on:{click:function(n){e.appendCommand("/clear"),e.showCommandDrawer=!1}}},[e._m(5),e._m(6)]),t("div",{staticClass:"command-item",on:{click:function(n){e.openFileSelect(),e.showCommandDrawer=!1}}},[e._m(7),e._m(8)])])])],1)},fpt=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"empty-icon"},[e("i",{staticClass:"fa-regular fa-comments"})])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"session-list-icon"},[e("i",{staticClass:"fa-solid fa-robot"})])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"command-icon"},[e("i",{staticClass:"fa-solid fa-microchip"})])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"command-icon"},[e("i",{staticClass:"fa-solid fa-compress-alt"})])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"command-info"},[e("div",{staticClass:"command-name"},[s._v("压缩会话")]),e("div",{staticClass:"command-desc"},[s._v("减少上下文长度")])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"command-icon"},[e("i",{staticClass:"fa-solid fa-trash"})])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"command-info"},[e("div",{staticClass:"command-name"},[s._v("清空对话")]),e("div",{staticClass:"command-desc"},[s._v("清空当前会话内容")])])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"command-icon"},[e("i",{staticClass:"fa-solid fa-file-circle-plus"})])},function(){var s=this,e=s._self._c;return e("div",{staticClass:"command-info"},[e("div",{staticClass:"command-name"},[s._v("选择文件")]),e("div",{staticClass:"command-desc"},[s._v("添加参考文件到上下文")])])}],gpt=en(upt,hpt,fpt,!1,null,"2352d831");const Tpe=gpt.exports,ppt={path:"/views/app",component:jgt,children:[{path:"",name:"app-index",component:Ygt,meta:{title:"首页"}},{path:"ChatViewApp",name:"app-ChatViewApp",component:Tpe,meta:{title:"对话"}},{path:"ChatViewApp/:id",name:"app-ChatViewApp-session",component:Tpe,meta:{title:"对话"}},{path:"FilesViewApp",name:"app-FilesViewApp",component:ept,meta:{title:"文件"}},{path:"GitChangesApp",name:"app-GitChangesApp",component:()=>ot(()=>import("./gitChangesApp-ZI7-V8oB.js"),__vite__mapDeps([2,3,4])),meta:{title:"Git 变更"}},{path:"DevWorkflowViewApp",name:"app-DevWorkflowViewApp",component:()=>ot(()=>import("./devWorkflowViewApp-DLslXEq9.js"),__vite__mapDeps([5,6])),meta:{title:"软件研发"}},{path:"settings",name:"app-settings",component:pve,meta:{title:"设置"}}]};Is.use(eve);const mpt=[{path:"/",redirect:"/views/pc/codeView"},ppt,{path:"/views/pc",component:()=>ot(()=>import("./PcLayout-ZTdJNg7G.js"),__vite__mapDeps([7,8])),children:[{path:"",redirect:"/views/pc/codeView"},{path:"codeView",name:"codeView",component:rce,meta:{title:"对话"}},{path:"codeView/:id",name:"codeView-session",component:rce,meta:{title:"对话"}},{path:"files",name:"files",component:Sft,meta:{title:"文件管理"}},{path:"fileZihao",name:"fileZihao",component:()=>ot(()=>import("./fileZihao-CtZ4bUIH.js"),[]),meta:{title:"文件互联"}},{path:"skills",name:"skills",component:Pgt,meta:{title:"Skill 管理"}},{path:"terminal",name:"terminal",component:()=>ot(()=>import("./terminalView-GTYtDlus.js"),__vite__mapDeps([9,10])),meta:{title:"终端"}},{path:"terminal/:id",name:"terminal-session",component:()=>ot(()=>import("./terminalView-GTYtDlus.js"),__vite__mapDeps([9,10])),meta:{title:"终端"}},{path:"db",name:"db",component:Wgt,meta:{title:"数据库"}},{path:"aiLogs",name:"aiLogs",component:()=>ot(()=>import("./aiLogsView-Bt8Xg1Qx.js"),[]),meta:{title:"AI 日志"}},{path:"tasks",name:"tasks",component:()=>ot(()=>import("./taskView-sOyebRqn.js"),[]),meta:{title:"任务列表"}},{path:"devWorkflow",name:"devWorkflow",component:()=>ot(()=>import("./devWorkflowView-BTozmaiN.js"),__vite__mapDeps([11,12,13])),meta:{title:"软件研发"}},{path:"settings",name:"settings",component:pve,meta:{title:"设置"}},{path:"git-changes",name:"gitChanges",component:()=>ot(()=>import("./gitChanges-DFRvzL5I.js"),__vite__mapDeps([14,3,15])),meta:{title:"Git 变更"}},{path:"custom-actions",name:"customActions",component:()=>ot(()=>import("./customActionsView-DdjnHzwm.js"),[]),meta:{title:"自定义操作"}},{path:"wiki",name:"wiki",component:()=>ot(()=>import("./wikiView-CRjg-cZ8.js"),__vite__mapDeps([16,17])),meta:{title:"文档"}},{path:"deploy",name:"deploy",component:()=>ot(()=>import("./deployView-Cj51_Job.js"),__vite__mapDeps([18,19])),meta:{title:"部署"}},{path:"designView",name:"designView",component:()=>ot(()=>import("./designView-RT8tKEN9.js"),__vite__mapDeps([20,12,21])),meta:{title:"软件设计"}}]}],Kxe=new eve({mode:"hash",routes:mpt});Kxe.afterEach(s=>{var e;(e=s.meta)!=null&&e.title&&(document.title=`${s.meta.title} - TXCode`)});Is.use(fOe);Is.prototype.$api=Yt;Is.config.productionTip=!1;new Is({router:Kxe,render:s=>s(vOe)}).$mount("#app");const Gxe=document.createElement("style");Gxe.textContent=".v-modal { z-index: 1999 !important; }";document.head.appendChild(Gxe);export{r4e as C,jAe as F,p2e as I,l3 as K,e2e as M,d2e as R,YAe as S,Yt as a,yFe as b,r2e as c,a3 as d,$b as e,e4e as f,Gn as g,dpt as h,sve as i,VN as m,en as n,CFe as s,m0e as t,x2e as u,Cd as w};
|